乐闻世界logo
搜索文章和话题

What are the most commonly used instructions in a Dockerfile?

浏览0
2月5日 23:28
  • FROM:Specify the base image.
  • RUN:Execute commands in the container.
  • CMD:Set the default command for the container.
  • ENTRYPOINT:Configure the command to run when the container starts.
  • COPY:Copy local files to the container.
  • ADD:Copy local or remote files to the container, supporting automatic decompression.
  • ENV:Set environment variables.
  • ARG:Define build-time variables.
  • EXPOSE:Declare the port that the container listens on at runtime.
  • WORKDIR:Set the working directory.
  • USER:Set the user to execute commands in the container.
  • LABEL:Add metadata to the image.
  • VOLUME:Create mount points for mounting data volumes or other containers.
标签:Docker