0

I have a container that is already running in production, but I have no clue how it was instantiated.

When running docker inspect I get :

[root ~]# docker inspect nova_libvirt
[
    {
        "Id": "b8b3c5fe243639765f5cf9da3bf63d10ce0390ba9351ce834acc1e2dc995500c",
        "Created": "2020-04-27T13:39:05.565536863Z",
        "Path": "dumb-init",
        "Args": [
            "--single-child",
            "--",
            "kolla_start"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 275828,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2021-03-01T09:54:56.449443024Z",
            "FinishedAt": "2021-03-01T09:54:56.005712036Z"
        },
        "Image": "sha256:01ad3421ed326320711b380a2143900c494ff5d09d3359cceb834d83be87fa0e",
        "ResolvConfPath": "/var/lib/docker/containers/b8b3c5fe243639765f5cf9da3bf63d10ce0390ba9351ce834acc1e2dc995500c/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/b8b3c5fe243639765f5cf9da3bf63d10ce0390ba9351ce834acc1e2dc995500c/hostname",
        "HostsPath": "/var/lib/docker/containers/b8b3c5fe243639765f5cf9da3bf63d10ce0390ba9351ce834acc1e2dc995500c/hosts",
        "LogPath": "/var/lib/docker/containers/b8b3c5fe243639765f5cf9da3bf63d10ce0390ba9351ce834acc1e2dc995500c/b8b3c5fe243639765f5cf9da3bf63d10ce0390ba9351ce834acc1e2dc995500c-json.log",
        "Name": "/nova_libvirt",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/dev:/dev:rw",
                "/etc/localtime:/etc/localtime:ro",
                "nova_compute:/var/lib/nova/:rw",
                "libvirtd:/var/lib/libvirt:rw",
                "/lib/modules:/lib/modules:ro",
                "nova_libvirt_qemu:/etc/libvirt/qemu:rw",
                "/run/:/run/:shared",
                "kolla_logs:/var/log/kolla/:rw",
                "/etc/kolla/nova-libvirt/:/var/lib/kolla/config_files/:ro",
                "/sys/fs/cgroup:/sys/fs/cgroup:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {
                    "max-file": "5",
                    "max-size": "50m"
                }
            },
            "NetworkMode": "host",
            "PortBindings": null,
            "RestartPolicy": {
                "Name": "unless-stopped",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "host",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": [
                "label=disable"
            ],
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": null,
            "ReadonlyPaths": null
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/11ef7944443812a53395157ee4aede8680fbfb9ac597eda86e2c093bcec118cc-init/diff:/var/lib/docker/overlay2/2af0d4e5773399882c40b005ef850c1c4d0558fc90b428f5bf8ccea7e5fc3af8/diff:/var/lib/docker/overlay2/efdc0804909359a050b4aeba4f0bf75382deef295f6e828bd15e084194faca54/diff:/var/lib/docker/overlay2/69d37aabb7906867243cc1e31d743169e071b3f153e51717ef3f3baf1b2e9ebf/diff:/var/lib/docker/overlay2/dd1431a7fc3a9aaf0c7d7c566c1279d9d5d3ad7fc03af30c2c506e9ab9870be0/diff:/var/lib/docker/overlay2/f40316ea2ae36e1e70c83516b72dac2c19c49a097257134d55b2655f8710fde2/diff:/var/lib/docker/overlay2/0171458501abd44d69851025bb7c0f561268170e6e1ef4bccac225b8a20a62f3/diff:/var/lib/docker/overlay2/809f837bd446d703443e3b3e2dda6e61182335796703c9a59f6cc9034b9fb3dc/diff:/var/lib/docker/overlay2/9648e5900c9996ae4bd5d101b417d40869f651bd35232399bd16594a5b4f27c6/diff:/var/lib/docker/overlay2/69d40d0330fb97d1278d7c4c7465c224cf3f77ecfb736312c857fa8412ad3f1d/diff:/var/lib/docker/overlay2/89128c3d61db9d103a551e0fe7b7ded9bdfbc946b5f4de38ef3674e9d539c81b/diff:/var/lib/docker/overlay2/990c5b921cc564d4bc1194601630346dcac7fd505e676e831c8070eb663bcce7/diff:/var/lib/docker/overlay2/d5acfc1e130a6f205c2c988fa8a1cda052155607491d4024f3af7ef3d266bd8d/diff:/var/lib/docker/overlay2/5a484ef0dbab98313e5353bb517a65346d264d84fe1a160dda07ca2e17206bf3/diff:/var/lib/docker/overlay2/09b98b7d1771867368a61e304f6e4fa16a219dcea144f3e39dca979acabb1b3c/diff:/var/lib/docker/overlay2/31f6915004b0d6e863242dc90eb259446d5cd814b1817af87cf09fda381c4408/diff:/var/lib/docker/overlay2/5d27ac85851ef08ad0e3c4fec87ac6a4e2f03ff73805929f26ed92a481c2ed29/diff:/var/lib/docker/overlay2/c879a64cd05abf2c7b467eed2cd190ef3ca0a20d5c3de3ba899d8bc5a9859481/diff:/var/lib/docker/overlay2/387a94915f00067540ba5300abea5f339facf11b153c3dade32ae2f30a01bc53/diff:/var/lib/docker/overlay2/c30bd84edefc02eae2223e36ef1a2f82be00a21ec8a74c6e4a88328fc84512c8/diff:/var/lib/docker/overlay2/c0ae4908e8725c9ddd2a5fa1b67f87dd3b1ce9a8092586234d3e315c4de0feb6/diff:/var/lib/docker/overlay2/5e8cdcc2373618e54628da29c6bd6597a09e79e7a6c55671b97d5aeb0dadd009/diff:/var/lib/docker/overlay2/6a3c773e5404dc89a3b2b885b9f99e9bbc726c2b8571911bc8230f369c7f49b9/diff:/var/lib/docker/overlay2/6f950ed2dc99233fd253f3fc69b4d576b0d0227eb5dcdcee7d23d83a328414d6/diff:/var/lib/docker/overlay2/a092bd1493f129264f0be5f300f4b93f9fe046d327e53c0fce22bee9b033465d/diff:/var/lib/docker/overlay2/d243bb995ff298e31def2dfce8b077e298d512ad3017e0554791b18fa37fc528/diff:/var/lib/docker/overlay2/dcf7521ae403c7ea3ef5cbc93d2c45247781ed5232726907b1f4a46f3682a173/diff:/var/lib/docker/overlay2/c2fc728cae8aeacc77d6b48f3f602987e4996893cffa5bd8f3ede723cd86aac6/diff:/var/lib/docker/overlay2/3eb1a6b158dccc03932dfe66a26f3bcc476d3e36dcb04113fe8e6bad7424a3ad/diff:/var/lib/docker/overlay2/4b7f039bc9be3b64a48ad9c36b32479d3c1bc21210f313f4bb16b01755d6486f/diff:/var/lib/docker/overlay2/399f1a7c4d78ef537dd4d654edc944b1c0393f6b2ec8ccd989bfb794a07b5770/diff:/var/lib/docker/overlay2/bb7687009fc2ede8497478ceab8bdea05daa6a124d4e8a431d2da370897a82fe/diff",
                "MergedDir": "/var/lib/docker/overlay2/11ef7944443812a53395157ee4aede8680fbfb9ac597eda86e2c093bcec118cc/merged",
                "UpperDir": "/var/lib/docker/overlay2/11ef7944443812a53395157ee4aede8680fbfb9ac597eda86e2c093bcec118cc/diff",
                "WorkDir": "/var/lib/docker/overlay2/11ef7944443812a53395157ee4aede8680fbfb9ac597eda86e2c093bcec118cc/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "volume",
                "Name": "nova_libvirt_qemu",
                "Source": "/var/lib/docker/volumes/nova_libvirt_qemu/_data",
                "Destination": "/etc/libvirt/qemu",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "bind",
                "Source": "/etc/localtime",
                "Destination": "/etc/localtime",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/etc/kolla/nova-libvirt",
                "Destination": "/var/lib/kolla/config_files",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "libvirtd",
                "Source": "/var/lib/docker/volumes/libvirtd/_data",
                "Destination": "/var/lib/libvirt",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "volume",
                "Name": "nova_compute",
                "Source": "/var/lib/docker/volumes/nova_compute/_data",
                "Destination": "/var/lib/nova",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "bind",
                "Source": "/dev",
                "Destination": "/dev",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/lib/modules",
                "Destination": "/lib/modules",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/run",
                "Destination": "/run",
                "Mode": "shared",
                "RW": true,
                "Propagation": "shared"
            },
            {
                "Type": "bind",
                "Source": "/sys/fs/cgroup",
                "Destination": "/sys/fs/cgroup",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "kolla_logs",
                "Source": "/var/lib/docker/volumes/kolla_logs/_data",
                "Destination": "/var/log/kolla",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "$HOSTNAME)",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "KOLLA_SERVICE_NAME=nova-libvirt",
                "KOLLA_CONFIG_STRATEGY=COPY_ALWAYS",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=en_US.UTF-8",
                "KOLLA_BASE_DISTRO=centos",
                "KOLLA_INSTALL_TYPE=source",
                "KOLLA_INSTALL_METATYPE=mixed",
                "KOLLA_DISTRO_PYTHON_VERSION=2.7",
                "KOLLA_BASE_ARCH=x86_64",
                "PS1=$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ "
            ],
            "Cmd": [
                "kolla_start"
            ],
            "Image": "harbor.chtrse.com/kolla/centos-source-nova-libvirt:train",
            "Volumes": {
                "/dev": {},
                "/etc/libvirt/qemu": {},
                "/etc/localtime": {},
                "/lib/modules": {},
                "/run/": {},
                "/sys/fs/cgroup": {},
                "/var/lib/kolla/config_files/": {},
                "/var/lib/libvirt": {},
                "/var/lib/nova/": {},
                "/var/log/kolla/": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "dumb-init",
                "--single-child",
                "--"
            ],
            "OnBuild": null,
            "Labels": {
                "build-date": "20200424",
                "kolla_version": "9.0.2",
                "maintainer": "Kolla Project (https://launchpad.net/kolla)",
                "name": "nova-libvirt",
                "org.label-schema.build-date": "20191001",
                "org.label-schema.license": "GPLv2",
                "org.label-schema.name": "CentOS Base Image",
                "org.label-schema.schema-version": "1.0",
                "org.label-schema.vendor": "CentOS"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "f08f5ee1e3b83d93c2ffc3dbc5c2ada4f5a0618acab9471b0c95c4bb3f5948d0",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/default",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "5ccb5bdfb29728cbaf4779d80a551cf88e6554a9486d44bb3638232e642be4a8",
                    "EndpointID": "dc305c855aaef946783ea903330967b09a90ad2e21eb93e584c7dbcae8f275e6",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]

The problem is I need to make a change to this container, which will require me to do the following:

  • Modify The Docker Image
  • Commit The Changes To The Docker Image
  • Stop and Remove The Old Container After Migrating Applications
  • Pull The New Docker Image
  • Run The Docker Container Again with The Same Specs and The New Image

The current container has several mounts as I can see, but there is some other things in there that I am unfamiliar with in terms of ARGS and what not. So my question is how can I interpret the required Docker Run Command from The Inspect Output?

blackbird
  • 132
  • 12
R. Barrett
  • 495
  • 5
  • 26

0 Answers0