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
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
add a comment |
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
add a comment |
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
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
docker
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
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
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.
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
add a comment |
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.
add a comment |
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.
add a comment |
.(dot) means current working directory.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 7 at 1:59
Trần Đức TâmTrần Đức Tâm
8571936
8571936
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 7 at 1:43
kichikkichik
20.1k26180
20.1k26180
add a comment |
add a comment |
.(dot) means current working directory.
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
add a comment |
.(dot) means current working directory.
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
add a comment |
.(dot) means current working directory.
.(dot) means current working directory.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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