What does . mean in docker? Does it mean the current working directory of the image or the local machine?How does one remove an image in Docker?Where are Docker images stored on the host machine?What is the difference between a Docker image and a container?How to force Docker for a clean build of an imagedocker COPY not working when deploying with docker-machineHow to use local docker images with Minikube?Does docker stack deploy work with local imagesCopy current directory in to docker imagedocker-compose vs docker run to load local docker images across the machinescopy docker image to docker-machine and get it working

15% tax on $7.5k earnings. Is that right?

Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?

Delete multiple columns using awk or sed

Why do ¬, ∀ and ∃ have the same precedence?

What is the highest possible scrabble score for placing a single tile

Were Persian-Median kings illiterate?

Is there a nicer/politer/more positive alternative for "negates"?

Biological Blimps: Propulsion

Why does this expression simplify as such?

Quoting Keynes in a lecture

Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?

How do I fix the group tension caused by my character stealing and possibly killing without provocation?

Does the Linux kernel need a file system to run?

Make a Bowl of Alphabet Soup

The Digit Triangles

Is this toilet slogan correct usage of the English language?

Why is the "ls" command showing permissions of files in a FAT32 partition?

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?

How can ping know if my host is down

Short story about a deaf man, who cuts people tongues

Why does the Sun have different day lengths, but not the gas giants?

Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?

Mimic lecturing on blackboard, facing audience

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?



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


How does one remove an image in Docker?Where are Docker images stored on the host machine?What is the difference between a Docker image and a container?How to force Docker for a clean build of an imagedocker COPY not working when deploying with docker-machineHow to use local docker images with Minikube?Does docker stack deploy work with local imagesCopy current directory in to docker imagedocker-compose vs docker run to load local docker images across the machinescopy docker image to docker-machine and get it working













2















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 local machine. Or is it the same meaning of . in most console commands like essentially selecting all in the current directory.



COPY somecode.java .

#copy the rest of the code

COPY . .


The . also seems to mean find the docker file in the current directory.



docker build -t image-tag .









share|improve this question




























    2















    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 local machine. Or is it the same meaning of . in most console commands like essentially selecting all in the current directory.



    COPY somecode.java .

    #copy the rest of the code

    COPY . .


    The . also seems to mean find the docker file in the current directory.



    docker build -t image-tag .









    share|improve this question


























      2












      2








      2








      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 local machine. Or is it the same meaning of . in most console commands like essentially selecting all in the current directory.



      COPY somecode.java .

      #copy the rest of the code

      COPY . .


      The . also seems to mean find the docker file in the current directory.



      docker build -t image-tag .









      share|improve this question
















      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 local machine. Or is it the same meaning of . in most console commands like essentially selecting all in the current directory.



      COPY somecode.java .

      #copy the rest of the code

      COPY . .


      The . also seems to mean find the docker file in the current directory.



      docker build -t image-tag .






      docker






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 4:59









      Trần Đức Tâm

      8571936




      8571936










      asked Mar 7 at 1:34









      Ni Nisan NijackleNi Nisan Nijackle

      81212




      81212






















          4 Answers
          4






          active

          oldest

          votes


















          3














          The . simply means "current working directory"



          docker build



          In the context of the docker build command, you are using it to signal that the build context for docker build is the current working directory. Like so:



          docker build -t mytag:0.1 .


          Let's say that you have this structure:



          /home/me/myapp/
          ├── Dockerfile
          ├── theapp.py


          And you invoke the docker build command from /home/me/myapp - you will pass the current working directory as the build context. This means that docker will see the following filestructure when building:



          /
          ├── Dockerfile
          ├── theapp.py


          Dockerfile



          In the context of a Dockerfile, it means that same. Both inside and outside the image.



          Take this COPY instruction for example:



          COPY . /app


          Here the . means the current working directory, where the docker build command is executed. This will be relative the to build context that is passed to the docker build command.



          For this COPY instruction:



          COPY theapp.py .


          It means, take the file theapp.py and copy it to the working directory of the docker image that is being built. This directory can be set at build time with the WORKDIR instruction, so that:



          WORKDIR /app
          COPY theapp.py .


          Would leave you with the file /app/theapp.py inside the resulting docker image.



          Finally, this COPY instruction:



          COPY . .


          Means take everything from the working directory where the docker build command is issued, relative to the build context that is passed to it. And copy it to the current working directory of the docker image.






          share|improve this answer

























          • of the image? of the local machine?

            – Ni Nisan Nijackle
            Mar 7 at 1:41






          • 1





            I added some to the answer, to try to clear this up. Please ask if something is still not clear.

            – Andreas Lorenzen
            Mar 7 at 1:49


















          3














          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] <location>".



          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.






          share|improve this answer






























            1














            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.






            share|improve this answer






























              0














              .(dot) means current working directory.






              share|improve this answer























              • on the image or the local machine?

                – Ni Nisan Nijackle
                Mar 7 at 1:42












              • The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                – Pahari Chora
                Mar 7 at 1:43











              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034727%2fwhat-does-mean-in-docker-does-it-mean-the-current-working-directory-of-the-im%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              The . simply means "current working directory"



              docker build



              In the context of the docker build command, you are using it to signal that the build context for docker build is the current working directory. Like so:



              docker build -t mytag:0.1 .


              Let's say that you have this structure:



              /home/me/myapp/
              ├── Dockerfile
              ├── theapp.py


              And you invoke the docker build command from /home/me/myapp - you will pass the current working directory as the build context. This means that docker will see the following filestructure when building:



              /
              ├── Dockerfile
              ├── theapp.py


              Dockerfile



              In the context of a Dockerfile, it means that same. Both inside and outside the image.



              Take this COPY instruction for example:



              COPY . /app


              Here the . means the current working directory, where the docker build command is executed. This will be relative the to build context that is passed to the docker build command.



              For this COPY instruction:



              COPY theapp.py .


              It means, take the file theapp.py and copy it to the working directory of the docker image that is being built. This directory can be set at build time with the WORKDIR instruction, so that:



              WORKDIR /app
              COPY theapp.py .


              Would leave you with the file /app/theapp.py inside the resulting docker image.



              Finally, this COPY instruction:



              COPY . .


              Means take everything from the working directory where the docker build command is issued, relative to the build context that is passed to it. And copy it to the current working directory of the docker image.






              share|improve this answer

























              • of the image? of the local machine?

                – Ni Nisan Nijackle
                Mar 7 at 1:41






              • 1





                I added some to the answer, to try to clear this up. Please ask if something is still not clear.

                – Andreas Lorenzen
                Mar 7 at 1:49















              3














              The . simply means "current working directory"



              docker build



              In the context of the docker build command, you are using it to signal that the build context for docker build is the current working directory. Like so:



              docker build -t mytag:0.1 .


              Let's say that you have this structure:



              /home/me/myapp/
              ├── Dockerfile
              ├── theapp.py


              And you invoke the docker build command from /home/me/myapp - you will pass the current working directory as the build context. This means that docker will see the following filestructure when building:



              /
              ├── Dockerfile
              ├── theapp.py


              Dockerfile



              In the context of a Dockerfile, it means that same. Both inside and outside the image.



              Take this COPY instruction for example:



              COPY . /app


              Here the . means the current working directory, where the docker build command is executed. This will be relative the to build context that is passed to the docker build command.



              For this COPY instruction:



              COPY theapp.py .


              It means, take the file theapp.py and copy it to the working directory of the docker image that is being built. This directory can be set at build time with the WORKDIR instruction, so that:



              WORKDIR /app
              COPY theapp.py .


              Would leave you with the file /app/theapp.py inside the resulting docker image.



              Finally, this COPY instruction:



              COPY . .


              Means take everything from the working directory where the docker build command is issued, relative to the build context that is passed to it. And copy it to the current working directory of the docker image.






              share|improve this answer

























              • of the image? of the local machine?

                – Ni Nisan Nijackle
                Mar 7 at 1:41






              • 1





                I added some to the answer, to try to clear this up. Please ask if something is still not clear.

                – Andreas Lorenzen
                Mar 7 at 1:49













              3












              3








              3







              The . simply means "current working directory"



              docker build



              In the context of the docker build command, you are using it to signal that the build context for docker build is the current working directory. Like so:



              docker build -t mytag:0.1 .


              Let's say that you have this structure:



              /home/me/myapp/
              ├── Dockerfile
              ├── theapp.py


              And you invoke the docker build command from /home/me/myapp - you will pass the current working directory as the build context. This means that docker will see the following filestructure when building:



              /
              ├── Dockerfile
              ├── theapp.py


              Dockerfile



              In the context of a Dockerfile, it means that same. Both inside and outside the image.



              Take this COPY instruction for example:



              COPY . /app


              Here the . means the current working directory, where the docker build command is executed. This will be relative the to build context that is passed to the docker build command.



              For this COPY instruction:



              COPY theapp.py .


              It means, take the file theapp.py and copy it to the working directory of the docker image that is being built. This directory can be set at build time with the WORKDIR instruction, so that:



              WORKDIR /app
              COPY theapp.py .


              Would leave you with the file /app/theapp.py inside the resulting docker image.



              Finally, this COPY instruction:



              COPY . .


              Means take everything from the working directory where the docker build command is issued, relative to the build context that is passed to it. And copy it to the current working directory of the docker image.






              share|improve this answer















              The . simply means "current working directory"



              docker build



              In the context of the docker build command, you are using it to signal that the build context for docker build is the current working directory. Like so:



              docker build -t mytag:0.1 .


              Let's say that you have this structure:



              /home/me/myapp/
              ├── Dockerfile
              ├── theapp.py


              And you invoke the docker build command from /home/me/myapp - you will pass the current working directory as the build context. This means that docker will see the following filestructure when building:



              /
              ├── Dockerfile
              ├── theapp.py


              Dockerfile



              In the context of a Dockerfile, it means that same. Both inside and outside the image.



              Take this COPY instruction for example:



              COPY . /app


              Here the . means the current working directory, where the docker build command is executed. This will be relative the to build context that is passed to the docker build command.



              For this COPY instruction:



              COPY theapp.py .


              It means, take the file theapp.py and copy it to the working directory of the docker image that is being built. This directory can be set at build time with the WORKDIR instruction, so that:



              WORKDIR /app
              COPY theapp.py .


              Would leave you with the file /app/theapp.py inside the resulting docker image.



              Finally, this COPY instruction:



              COPY . .


              Means take everything from the working directory where the docker build command is issued, relative to the build context that is passed to it. And copy it to the current working directory of the docker image.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 7 at 1:50

























              answered Mar 7 at 1:41









              Andreas LorenzenAndreas Lorenzen

              1,036412




              1,036412












              • of the image? of the local machine?

                – Ni Nisan Nijackle
                Mar 7 at 1:41






              • 1





                I added some to the answer, to try to clear this up. Please ask if something is still not clear.

                – Andreas Lorenzen
                Mar 7 at 1:49

















              • of the image? of the local machine?

                – Ni Nisan Nijackle
                Mar 7 at 1:41






              • 1





                I added some to the answer, to try to clear this up. Please ask if something is still not clear.

                – Andreas Lorenzen
                Mar 7 at 1:49
















              of the image? of the local machine?

              – Ni Nisan Nijackle
              Mar 7 at 1:41





              of the image? of the local machine?

              – Ni Nisan Nijackle
              Mar 7 at 1:41




              1




              1





              I added some to the answer, to try to clear this up. Please ask if something is still not clear.

              – Andreas Lorenzen
              Mar 7 at 1:49





              I added some to the answer, to try to clear this up. Please ask if something is still not clear.

              – Andreas Lorenzen
              Mar 7 at 1:49













              3














              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] <location>".



              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.






              share|improve this answer



























                3














                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] <location>".



                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.






                share|improve this answer

























                  3












                  3








                  3







                  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] <location>".



                  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.






                  share|improve this answer













                  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] <location>".



                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 7 at 1:59









                  Trần Đức TâmTrần Đức Tâm

                  8571936




                  8571936





















                      1














                      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.






                      share|improve this answer



























                        1














                        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.






                        share|improve this answer

























                          1












                          1








                          1







                          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.






                          share|improve this answer













                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 7 at 1:43









                          kichikkichik

                          20.1k26180




                          20.1k26180





















                              0














                              .(dot) means current working directory.






                              share|improve this answer























                              • on the image or the local machine?

                                – Ni Nisan Nijackle
                                Mar 7 at 1:42












                              • The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                                – Pahari Chora
                                Mar 7 at 1:43
















                              0














                              .(dot) means current working directory.






                              share|improve this answer























                              • on the image or the local machine?

                                – Ni Nisan Nijackle
                                Mar 7 at 1:42












                              • The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                                – Pahari Chora
                                Mar 7 at 1:43














                              0












                              0








                              0







                              .(dot) means current working directory.






                              share|improve this answer













                              .(dot) means current working directory.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 7 at 1:41









                              Pahari ChoraPahari Chora

                              96431632




                              96431632












                              • on the image or the local machine?

                                – Ni Nisan Nijackle
                                Mar 7 at 1:42












                              • The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                                – Pahari Chora
                                Mar 7 at 1:43


















                              • on the image or the local machine?

                                – Ni Nisan Nijackle
                                Mar 7 at 1:42












                              • The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                                – Pahari Chora
                                Mar 7 at 1:43

















                              on the image or the local machine?

                              – Ni Nisan Nijackle
                              Mar 7 at 1:42






                              on the image or the local machine?

                              – Ni Nisan Nijackle
                              Mar 7 at 1:42














                              The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                              – Pahari Chora
                              Mar 7 at 1:43






                              The last .(dot) represent current working directory. But .(dot) with COPY will be local(source) and image (remote target)

                              – Pahari Chora
                              Mar 7 at 1:43


















                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034727%2fwhat-does-mean-in-docker-does-it-mean-the-current-working-directory-of-the-im%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                              Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                              Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved