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

前端 未结 4 1248
误落风尘
误落风尘 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:10

    I saw 3 . characters on your question, so let me expand one by one.

    The first, as you imagine, the . character means the current directory.

    In your Dockerfile

    COPY . .
    

    The second dot represented the current location on your virtual machine. Whenever you run cd command in the Dockerfile. That may be easy to understand.

    The first dot more unintelligible a little. The first dot character represented the current location on your host machine. The location you input after docker build command like that:"docker build [options] ".

    Docker build command

    The dot character means the current directory whenever you call your docker build command. For example:

    [~]$ docker build .

    The dot character represented for default home directory of this user on your real machine.

提交回复
热议问题