Docker Community Forums

Share and learn in the Docker community.

Difficulties to commit container with <change> flag


(Sivadevdocker) #1


The context of my work is:
I need to mechanise the installation of a software. So I build a first image containing puppet, then I created a container from this image. Now I want to commit this container adding the command puppet agent -t, for a test I just try to make a copy of a file in the new container created from the commited image.
For me, the command line is: docker commit --change='CMD ["cp", "/etc/yum.conf", "/etc/yumtest"]' idcontainer newimage
The new image is well created but I’m not able to enter in the container where the file is suposed to be copied, can you please tell me why?
Besides this, the command docker commit --change='CMD ["cp", "/etc/yum.conf", "/etc/yumtest"]' idcontainer newimage, is it right to do what I want to do?


(Sivadevdocker) #2

It’s finally fixed, just forget to add -c option with /bin/bash command