首页 > 其他 > 详细

docker

时间:2018-05-24 17:45:10      阅读:351      评论:0      收藏:0      [点我收藏+]

in DockerFile 

ockerfile contains instructions on how the image should be built. Here are some of the most common instructions that you can meet in a Dockerfile:

  • FROM is used to specify a base image for this build. It‘s similar to the builder configuration which we defined in a Packer template, but in this case instead of describing characteristics of a VM, we simply specify a name of a container image used for build. This should be the first instruction in the Dockerfile.
  • ADD and COPY are used to copy a file/directory to the container. See the difference between the two.
    • ADD allows <src> to be an URL
    • If the <src> parameter of ADD is an archive in a recognised compression format, it will be unpacked 
  • RUN is used to run a command inside the image. Mostly used for installing packages.
  • ENV sets an environment variable available within the container.
  • WORKDIR changes the working directory of the container to a specified path. It basically works like a cdcommand on Linux.
  • CMD sets a default command, which will be executed when a container starts. This should be a command to start your application.
  •  

docker

原文:https://www.cnblogs.com/anyu686/p/9084052.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!