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
• 14,080 points
34 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
• 37,320 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer

How do I get into a Docker container?

docker attach will let you connect to your ...READ MORE

answered Aug 10, 2018 in Docker by Kalgi
• 37,320 points
42 views
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,160 points
95 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,900 points
52 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
• 37,320 points
46 views