1

I am reusing an image, and did a commit.

$ sudo docker images
[sudo] password for pt008300: 
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
fedorawasdebug                   version3            d23b147131f6        2 weeks ago         39.2 GB
fedorawasdebug                   version2            001462545456        3 weeks ago         35.1 GB
docker.io/kgibm/fedorawasdebug   latest              99bb564492a4        4 months ago        33.8 GB
docker.io/hello-world            latest              fce289e99eb9        16 months ago       1.84 kB

When I try to run the commited image:

sudo docker run --cap-add SYS_PTRACE --cap-add NET_ADMIN --ulimit core=-1 --ulimit memlock=-1 --ulimit stack=-1 --shm-size="256m" --rm -p 122:22 -p 5902:5902 -it fedorawasdebug:version3

I have problems:

Warning: 4ca840e16811:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server 4ca840e16811:1
A VNC server is already running as :1

My question is, what is the right procedure after commit an image to stop it and start from the committed version?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • Please provide the complete steps you ran to produce the image. (Better still, provide them in the form of a `Dockerfile` so that you can run `docker build` to reproduce the image – `docker commit` isn't really a best practice.) – David Maze May 04 '20 at 20:55
  • @DavidMaze, actually it was not me that build the image, I have downloaded from a git. I am using it has a lab, I have updated it, and wanted to persist my changes. For that reason I did as I described above the commit. If commit is not the best practice. Can you describe me or give me a link to some documentation about the best practice to persist changes to a docker image?! – João Pedro Alexandre May 05 '20 at 16:24
  • The Docker [Build and run your image](https://docs.docker.com/get-started/part2/) tutorial walks through the basic process of building and running custom images. When you write your Dockerfile you can name any image you want in the `FROM` line, so you can use this approach to extend an existing image. – David Maze May 05 '20 at 16:29
  • Thanks @DavidMaze . I am going to read that tutorial. – João Pedro Alexandre May 12 '20 at 09:51

0 Answers0