Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot save docker container

To start off, I am new to docker.
I am running docker on a ubuntu server.

I created a new container using

 sudo docker run -ti --rm ubuntu /bin/bash

but when I try to save

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

root@fb3811666c85:/# docker commit -p fb3811666c85 mycontainer

I get

bash: docker: command not found

I also tried

root@fb3811666c85:/# sudo docker commit -p fb3811666c85 mycontainer

and got

sudo: docker: command not found

What am I doing wrong?

>Solution :

This command is not run from within the container. (Your container doesn’t have docker, so the error is obvious. But even if it had docker, it wouldn’t achieve the result that you are seeking. Might probably complain about the container being not available. If you are using the host socket, then it might not happen).

In one terminal open a container, make changes that you want.
In second terminal, run docker ps. Copy the container id. Run the command.
In your command, instead of myContainer, I think you’d want to use myImage:myNewTag.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading