Hide Forgot
Description of problem: Running a container then export it to specified path then recovery it again after resetting storage, the original command in running container is replaced w/ "/run/gotar -xf -", obviously, it will be failed to start it by docker. In addition, could we recovery running container w/ previous specified name? at present, the container is imported by random name, although you gave a name for running container before resetting storage. Version-Release number of selected component (if applicable): [root@atomic-host-001 cloud-user]# cat /etc/redhat-release Red Hat Enterprise Linux Atomic Host release 7.3 [root@atomic-host-001 cloud-user]# rpm -q atomic docker atomic-1.12.5-2.el7.x86_64 docker-1.10.3-55.el7.x86_64 How reproducible: always Steps to Reproduce: 1. docker pull busybox 2. docker run -itd --name storage_test busybox /bin/sh 3. atomic storage export --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker 4. systemctl stop docker 5. atomic storage reset 6. systemctl start docker 7. atomic -y storage import --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker 8. docker ps -a 9. docker start <container_id> Actual results: [root@atomic-host-001 cloud-user]# docker run -itd --name storage_test busybox /bin/sh a98e0e1a4fbc665d859e3a3b7b34ed5efd823f83309b3e2a3b1b2cff1250c003 [root@atomic-host-001 cloud-user]# atomic storage export --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker Exporting image: e02e811dd08f Exporting container: a98e0e1a4fbc Exporting volumes atomic export completed successfully [root@atomic-host-001 cloud-user]# systemctl stop docker [root@atomic-host-001 cloud-user]# atomic storage reset [root@atomic-host-001 cloud-user]# systemctl start docker [root@atomic-host-001 cloud-user]# atomic -y storage import --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker Importing image: e02e811dd08f Importing container: a98e0e1a4fbc Importing volumes atomic import completed successfully Deleting /tmp/atomic_storage_export_1 [root@atomic-host-001 cloud-user]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a98e0e1a4fbc e02e811dd08f "/run/gotar -xf -" 26 seconds ago Exited (0) 24 seconds ago high_ardinghelli [root@atomic-host-001 cloud-user]# docker start a98e0e1a4fbc Error response from daemon: Cannot start container a98e0e1a4fbc665d859e3a3b7b34ed5efd823f83309b3e2a3b1b2cff1250c003: [9] System error: exit status 1 Error: failed to start containers: a98e0e1a4fbc Expected results: the container command should be previous command not "/run/gotar -xf -", it had better to keep previous container name, it will be convenient for users to recovery previous container by name later. Additional info:
Hi Alex, Initially after the import, the entry point to the container would be "/run/gotar -xf -". However the user gets a message "Please restart docker daemon for the changes to take effect". N Once the user restart the docker daemon, things are back to how it was originally. What I am wondering is why you didn't get that message? I tried this on a F24 VM with atomic rpm package. N This works fine for me. sh-4.3# atomic -y storage import --dir /tmp/atomic_storage_export_1 --graph /var/lib/docker Importing image: e02e811dd08f Importing container: 3c3793af0306 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning. Importing volumes atomic import completed successfully Deleting /tmp/atomic_storage_export_1 **************************************************************************** Please restart docker daemon for the changes to take effect **************************************************************************** sh-4.3# systemctl restart docker sh-4.3# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3c3793af0306 busybox "/bin/sh" 4 minutes ago Exited (137) 2 seconds ago storage_test Shishir
(In reply to smahajan from comment #2) > Hi Alex, > > Initially after the import, the entry point to the container would be > "/run/gotar -xf -". However the user gets a message "Please restart docker > daemon for the changes to take effect". N Once the user restart the docker Shishir, thanks for your details, I forgot to restart docker daemon, everything is okay now.