-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the purpose of COPY --from=gloursdocker/docker / /
?
#401
Comments
google search first result to "gloursdocker/docker" : |
@zozitak thank you. I saw it, but still it's pretty hard to figure out what it exactly does. |
Copying all the contents of the root directory (/) from the |
Thanks for your answer. I believe, most of us here understand, what that command literally does. I hopped for a bit more explanation on why the root directory was copied and some elaboration about the effects of this copying… |
When you build a Docker image, each instruction in the Dockerfile creates a new layer on top of the previous one
so here we are copying the entire contents of the we need not build the same image again and used the cached one from
|
I found this thread after asking myself the same question, and like @lucassus , I'm still unclear of what the purpose of the line is? I understand it copies some files from the The files it copies - such as docker and docker-compose - are used from the host rather than inside the container, so the purpose of copying them into an image during build time is a mystery. Maybe there's a specific use case, but I can't think of what it might be. |
TBH my first thought was that this copy from gloursdocker/docker might be a way to inject some malware. Imagine a situation where someone silently does something nasty with this image. |
This instruction, for some reason, is used in many examples.
The comment
install Docker tools (cli, buildx, compose)
in my opinion, is not really helpful.The text was updated successfully, but these errors were encountered: