I lose my data when I get out of the container

0 votes
I lose the data everytime I leave the container or when the container exits(idk if exits is the right word to use here).

Is there something wrong with my installation?

If not please let me know whats the issue
Jul 26, 2018 in Docker by Hannah
• 18,410 points
221 views

1 answer to this question.

0 votes

No its not installation issue.

You need to commit the changes you make to the container and then run it. Try this:

sudo docker pull ubuntu
sudo docker run ubuntu apt-get install -y ping

Then get the container id using this command:

sudo docker ps -l

Commit changes to the container:

sudo docker commit <container_id> iman/ping 

Then run the container:

sudo docker run iman/ping ping www.google.com

This should work.

answered Jul 26, 2018 by Kalgi
• 51,950 points

Related Questions In Docker

0 votes
1 answer

Will I lose my data, when a docker container exists?

No, you won’t lose any data when ...READ MORE

answered Jul 30, 2019 in Docker by Kavya
507 views
0 votes
1 answer

Why do I get Connection reset by peer when making a request to a service running in a container?

Typically, this message is returned if the ...READ MORE

answered Jul 9, 2019 in Docker by Sirajul
• 57,870 points
1,943 views
0 votes
1 answer

if I remove one container will my volume also get deleted

If the volume is being referenced to ...READ MORE

answered Nov 25, 2019 in Docker by Aria
75 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,640 points
760 views
0 votes
2 answers

How can I inspect the file system of a failed `docker build

Failed command is a build that has ...READ MORE

answered Aug 6, 2018 in Docker by Nilesh
• 6,980 points
542 views
0 votes
1 answer

Docker, how to get container information from within the container?

I've found out that the container id ...READ MORE

answered Jul 31, 2018 in Docker by Kalgi
• 51,950 points
179 views