Create a Docker Image From Container

Hello, please review the assigned task, since if the ubuntu_latest image does not exist, only ubuntu tag latest exists. Thank you very much for the tasks

Actually you don’t need to create a Dockerfile and build image from that file. You have to create a image from ubuntu_latest docker container.
If you will do "docker ps" , you get a list of docker containers.

Thank you very much, completely forgot to validate the docker that were running, regards.-

hi @Tej-Singh-Rana @contardorm
is this correct for this task?
thanks

@Inderpreet
Please check and advise here.
thanks

Hello, @swaroopcs88
Please take a look into the docs and given examples.

One of the Nautilus developer was working to test new changes on a container. He wants to keep a backup of his changes to the container. A new request has been raised for the DevOps team to create a new image from this container. Below are more details about it:

a. Create an image beta:nautilus on Application Server 2 from a container ubuntu_latest that is running on same server.

I have done the following:

[root@stapp02 steve]# docker images

REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
ubuntu       latest    e0f16e6366fe   4 weeks ago   78.1MB

[root@stapp02 steve]# docker ps -a
CONTAINER ID   IMAGE     COMMAND       CREATED              STATUS    PORTS     NAMES
204c0a478c08   ubuntu    "/bin/bash"   About a minute ago   Created             ubuntu_latest

[root@stapp02 steve]# docker restart ubuntu_latest

Error response from daemon: Cannot restart container ubuntu_latest: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "proc" to rootfs at "/proc": mount src=proc, dst=/proc, dstFd=/proc/thread-self/fd/9, flags=0xe: no such file or directory: unknown

[root@stapp02 steve]# docker start ubuntu_latest

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "proc" to rootfs at "/proc": mount src=proc, dst=/proc, dstFd=/proc/thread-self/fd/9, flags=0xe: no such file or directory: unknown
Error: failed to start containers: ubuntu_latest

[root@stapp02 steve]# docker ps -a
CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS    PORTS     NAMES
204c0a478c08   ubuntu    "/bin/bash"   4 minutes ago   Created             ubuntu_latest

[root@stapp02 steve]# docker commit  ubuntu_latest beta:nautilus
sha256:b5d827867950d78ea2ae54f2d1d40c94e0d43c584aca1cd689400ed0186f28ed

[root@stapp02 steve]# docker images
REPOSITORY   TAG        IMAGE ID       CREATED         SIZE

beta         nautilus   b5d827867950   8 seconds ago   78.1MB

ubuntu       latest     e0f16e6366fe   4 weeks ago     78.1MB


[root@stapp02 steve]# docker ps -a

CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS    PORTS     NAMES
204c0a478c08   ubuntu    "/bin/bash"   6 minutes ago   Created             ubuntu_latest

I am getting the following error

Getting the following error while running docker start and restart command.
Also notice in the output of the docker ps -a command above the status of the container is “created”.

[root@stapp02 steve]# docker start ubuntu_latest
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "proc" to rootfs at "/proc": mount src=proc, dst=/proc, dstFd=/proc/thread-self/fd/9, flags=0xe: no such file or directory: unknown
Error: failed to start containers: ubuntu_latest

Kindly help.
Thank You.