-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore: build x86_64-unknown-linux-musl with all features #669
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
Conversation
3265981
to
b0e1a8e
Compare
Note that the resulting binary is not fully static, as it is linked dynamically to both It means that it can be used to create an Alpine-based Docker image, but not a stand-alone binary that can be distributed separately. I think this repo looks like a promising base to build fully static binary, I'm actually going to try it out and report the results later. |
Ah got it. Yeah, this is definitely not my area of expertise. I'll see if I can adjust this for the Alpine image only. |
I'll try to create a PR that would build an Alpine image without dev dependencies using multi-stage builds. |
Sure, I was just going to update this Dockerfile and do exactly what you said with the multi-stage build. |
Signed-off-by: Ben Johnson <[email protected]>
Signed-off-by: Ben Johnson <[email protected]>
Signed-off-by: Ben Johnson <[email protected]>
0f7d4a9
to
0bab356
Compare
I updated the |
0bab356
to
d2f8cc4
Compare
Signed-off-by: Ben Johnson <[email protected]>
FROM alpine:3.10.1 | ||
|
||
RUN apk add g++ gcc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here libgcc
and libstd++
can be be used, so the command can be like
RUN apk --no-cache add libgcc libstdc++
to keep to container smaller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
Signed-off-by: Ben Johnson <[email protected]>
Signed-off-by: Ben Johnson <[email protected]>
|
||
COPY --from=builder /release/bin/* /usr/local/bin/ | ||
COPY --from=builder /release/etc/vector /etc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this missing an entrypoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is proper Docker etiquette here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is a container someone might use to run vector then you want the entry point to be the binary. Check below.
https://github.com/timberio/vector/blob/434bed8bce6d78517d9d8c07240305df0512ec27/Dockerfile#L40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@binarylogic I think if we can add the entrypoint back then its a +1 from me.
RUN apk --no-cache add libgcc libstdc++ | ||
|
||
COPY --from=builder /release/bin/* /usr/local/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we copying this folder? I think at a min we should only copy what we need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That folder is designed to hold any binaries we want to ship, which currently is only vector
. I thought it was more future proof to do it this way.
Signed-off-by: Ben Johnson <[email protected]>
6fbaf63
to
b2b5567
Compare
@a-rodin demonstrated a full build on Alpine linux (#661 (comment)) which allows us to release a full build for target
x86_64-unknown-linux-musl
without limited features. This change updates our release process for that target to follow that example.Ref #661, #630, #654