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
• 16,210 points
62 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
• 41,990 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 in Docker by Kavya
45 views
0 votes
1 answer
0 votes
1 answer
0 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
• 56,900 points
216 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,880 points
98 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
• 41,990 points
68 views