chore: build x86_64-unknown-linux-musl with all features#669
chore: build x86_64-unknown-linux-musl with all features#669binarylogic merged 7 commits intomasterfrom
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.
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.
Signed-off-by: Ben Johnson <[email protected]>
Signed-off-by: Ben Johnson <[email protected]>
| RUN apk --no-cache add libgcc libstdc++ | ||
|
|
||
| COPY --from=builder /release/bin/* /usr/local/bin/ | ||
| COPY --from=builder /release/etc/vector /etc No newline at end of file |
There was a problem hiding this comment.
is this missing an entrypoint?
There was a problem hiding this comment.
What is proper Docker etiquette here?
There was a problem hiding this comment.
if this is a container someone might use to run vector then you want the entry point to be the binary. Check below.
LucioFranco
left a comment
There was a problem hiding this comment.
@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.
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.
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-muslwithout limited features. This change updates our release process for that target to follow that example.Ref #661, #630, #654