Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what "--from=builder" do in Dockerfile

I am trying to understand the dockerfile for implementing egress-operator. Can someone let me know what does line :

COPY --from=builder /workspace/manager . AND ENTRYPOINT ["/manager"] mean here and what are they trying to do at ENTRYPOINT ["/manager"] ?

Are they running manager script then it should be something like ENTRYPOINT ["./manager"] or they are trying simply cd to /manager folder ?

like image 457
solveit Avatar asked Aug 30 '26 16:08

solveit


2 Answers

builder is the name of a previous stage in the multi-stage Dockerfile. It is probably building the application manager. Once the builder is complete, this current stage copies the manager file into the current image /workspace directory. The entrypoint simply gives the program that will run when the container starts.

You can find more detailed explanations here:

https://docs.docker.com/engine/reference/builder/

like image 148
Burak Serdar Avatar answered Sep 01 '26 07:09

Burak Serdar


Normally a COPY command would copy a file from the build context into the image. But with --from it instead copies from the filesystem of a previous build stage. Somewhere above that you'll see FROM whatever AS builder and some build instructions, so it's copying from that.

like image 43
coderanger Avatar answered Sep 01 '26 07:09

coderanger