What does . mean in docker? Does it mean the current working directory of the image or the local machine?

前端 未结 4 1261
误落风尘
误落风尘 2021-01-04 09:43

I am confused about whether . means that it\'s a shortened abbreviation of the current directory of the image or if it\'s the current working directory on the l

4条回答
  •  醉话见心
    2021-01-04 10:21

    It depends on the context. In your COPY somecode.java . it's the image. In COPY . . it's both. The first dot is in the local machine and the second dot is the image.

    In the docker build command, it tells Docker to take files for the newly built image from the working directory on your local machine.

    As others said, it's basically just means "current working directory". But when building a Docker image, there are two of those. One in your local machine where you're building the image. The second one is the file system that's built in the image.

提交回复
热议问题