-
Notifications
You must be signed in to change notification settings - Fork 137
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
Build binaries as part of Docker #323
Conversation
Codecov Report
@@ Coverage Diff @@
## master #323 +/- ##
=======================================
Coverage 23.79% 23.79%
=======================================
Files 14 14
Lines 1244 1244
=======================================
Hits 296 296
Misses 928 928
Partials 20 20 Continue to review full report at Codecov.
|
cmd/tink-server/Dockerfile
Outdated
EXPOSE 42113 | ||
EXPOSE 42114 | ||
|
||
RUN apk add --update ca-certificates && \ | ||
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing cfssl | ||
|
||
COPY tink-server /bin/ | ||
ENTRYPOINT ["/usr/bin/tink-server"] |
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.
I think lets keep the image "metadata" together at the top and then the contents after so it would be like:
FROM alpine:3.11
EXPOSE 42113
EXPOSE 42114
ENTRYPOINT ["/usr/bin/tink-server"]
RUN apk add ...
COPY --from=0 ...
Notice I re-arranged the COPY, RUN -> RUN, COPY so we can re-use the RUN apk cached entry.
cmd/tink-worker/Dockerfile
Outdated
COPY --from=0 /usr/myapp/cmd/tink-worker/tink-worker /usr/bin/tink-worker | ||
RUN apk add --no-cache --update --upgrade ca-certificates | ||
|
||
COPY tink-worker /tink-worker | ||
ENTRYPOINT [ "/usr/bin/tink-worker" ] |
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.
ditto, lets do ENTRYPOINT, RUN, COPY to make best use of cache.
cmd/tink-cli/Dockerfile
Outdated
RUN apk add --no-cache --update --upgrade ca-certificates | ||
|
||
COPY tink-cli /bin/tink | ||
COPY sample.tmpl /tmp | ||
COPY --from=0 /usr/myapp/cmd/tink-cli/tink-cli /usr/bin/tink-cli | ||
ENTRYPOINT ["/usr/bin/tink-cli"] |
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.
ditto, lets do ENTRYPOINT, RUN, COPY to make best use of cache and keep groupings of metadata vs content
Moving the binary compilation as part of Docker we will be able to leverage the multi architecture support Docker has to provide images that can run on different architecture such as x64_86, ARM. Signed-off-by: Gianluca Arbezzano <[email protected]>
Signed-off-by: Gianluca Arbezzano <[email protected]>
Description
Moving the binary compilation as part of Docker we will be able to
leverage the multi-architecture support Docker has to provide images
that can run on different architecture such as x64_86, ARM.
Why is this needed
Reference: #312