Skip to content
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

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Build binaries as part of Docker #323

merged 2 commits into from
Oct 27, 2020

Conversation

gianarb
Copy link
Contributor

@gianarb gianarb commented Oct 8, 2020

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

@gianarb gianarb requested review from mmlb and parauliya October 8, 2020 12:28
@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #323 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b477fd...8395803. Read the comment docs.

@thebsdbox
Copy link
Contributor

image

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"]
Copy link
Contributor

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.

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" ]
Copy link
Contributor

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.

Comment on lines 8 to 10
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"]
Copy link
Contributor

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

@gianarb gianarb requested a review from mmlb October 14, 2020 09:55
mmlb
mmlb previously approved these changes Oct 19, 2020
@gianarb gianarb requested a review from mmlb October 19, 2020 14:07
@gianarb gianarb added the ready-to-merge Signal to Mergify to merge the PR. label Oct 19, 2020
mmlb
mmlb previously approved these changes Oct 19, 2020
@gianarb gianarb requested review from mmlb and removed request for parauliya October 27, 2020 15:34
mmlb
mmlb previously approved these changes Oct 27, 2020
Gianluca Arbezzano added 2 commits October 27, 2020 19:06
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]>
@gianarb gianarb merged commit bb12047 into tinkerbell:master Oct 27, 2020
@gianarb gianarb mentioned this pull request Oct 27, 2020
@kqdeng kqdeng mentioned this pull request Oct 29, 2020
3 tasks
@mmlb mmlb removed the ready-to-merge Signal to Mergify to merge the PR. label Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants