docker commit command

  docker commit command is used to create a new image based on a docker container.

       docker commit crafted mirror, mirror in addition to developing people know what command executed, how the generated image, others simply do not know. Dockerfile is recommended to make the mirror, image generation process is transparent, docker commit operation site or the like may be used to hold the invasion.

       Usage is: docker commit [OPTIONS] CONTAINER [REPOSITORY [: TAG]]

 

parameter Defaults effect
—author, -a     author information
—change, -c   The directive applies to images created Dockerfile
—message, -m   Submit news
—pause, -p true During the pause container submitted

         

  By default, the container being submitted and the process will be suspended if the image submitted. This reduces the likelihood of encountering corrupt data submitted in the creation process. If you do not need this behavior, set the --pauseoption to false. --changeOption to apply an image Dockerfile command will create. Support Dockerfile instructions:

  CMD|ENTRYPOINT|ENV|EXPOSE|LABEL|ONBUILD|USER|VOLUME|WORKDIR   

docker commit --change='CMD ["apachectl", "-DFOREGROUND"]' -c "EXPOSE 80" c3f279d17e0a svendowideit/testimage:version4

        

  save image save & load [not] container
  # Save
  Docker Save vell001 / TF-keras> TF-keras.tar
  # Load
  Docker Load <TF-keras.tar


  export & import container persistence] [
  Docker Export 33f6c8359187> TF-keras-33f6c8359187.tar
  Docker Import-TF-keras 33f6c8359187.ta

Guess you like

Origin www.cnblogs.com/lnlvinso/p/11129505.html