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

Update Dockerfile to match upstream changes #66

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG GO_IMAGE=rancher/hardened-build-base:v1.21.11b3

# Image that provides cross compilation tooling.
FROM --platform=$BUILDPLATFORM rancher/mirrored-tonistiigi-xx:1.3.0 as xx

Check warning on line 4 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-arm64

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

FROM --platform=$BUILDPLATFORM ${GO_IMAGE} as base-builder

Check warning on line 6 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-arm64

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
# copy xx scripts to your build stage
COPY --from=xx / /
RUN apk add file make git clang lld patch
Expand All @@ -12,7 +12,7 @@
xx-apk --no-cache add musl-dev gcc lld

# Build the multus project
FROM base-builder as multus-builder

Check warning on line 15 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-arm64

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
ARG TAG=v4.1.0
ARG SRC=github.com/k8snetworkplumbingwg/multus-cni
ARG PKG=github.com/k8snetworkplumbingwg/multus-cni
Expand All @@ -28,15 +28,21 @@
./hack/build-go.sh
RUN xx-verify --static bin/thin_entrypoint bin/multus

FROM ${GO_IMAGE} as strip_binary

Check warning on line 31 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-arm64

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
#strip needs to run on TARGETPLATFORM, not BUILDPLATFORM
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/bin/thin_entrypoint /thin_entrypoint
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/bin/multus /multus
RUN strip /thin_entrypoint /multus
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/bin/kubeconfig_generator /kubeconfig_generator
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/bin/cert-approver /cert-approver
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/bin/install_multus /install_multus
RUN strip /thin_entrypoint /multus /kubeconfig_generator /cert-approver /install_multus

# Create the multus image
FROM scratch as multus-cni

Check warning on line 41 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-arm64

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
COPY --from=strip_binary /multus /usr/src/multus-cni/bin/multus
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/LICENSE /usr/src/multus-cni/LICENSE
COPY --from=strip_binary /thin_entrypoint /
COPY --from=strip_binary /kubeconfig_generator /
COPY --from=strip_binary /cert-approver /
COPY --from=strip_binary /install_multus /
ENTRYPOINT ["/thin_entrypoint"]