Skip to content

Doubt: How is the dockerfile able to generate executable as there is no command that builds it #3459

Answered by mx-psi
AJ-54 asked this question in Q&A
Discussion options

You must be logged in to vote

The Makefile task first builds the binary and copies it to the cmd/otelcol folder

GOOS=linux $(MAKE) $(COMPONENT)
cp ./bin/$(COMPONENT)_linux_amd64 ./cmd/$(COMPONENT)/$(COMPONENT)
then the Dockerfile copies the binary from the build context folder to the otelcol image and finally it gets copied to the last stage
COPY --from=otelcol /otelcol /
(this is a multi-stage build)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AJ-54
Comment options

Answer selected by jrcamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants