-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Dockerfile to use native docker features to target the speci…
…fic image Signed-off-by: Marco Franssen <[email protected]>
- Loading branch information
1 parent
6994eb4
commit 18a08a4
Showing
2 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,23 @@ | |
# Copyright Authors of Cilium | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# FINAL_CONTAINER specifies the source for the output | ||
# cilium-cli-ci (default) is based on ubuntu with cloud CLIs | ||
# cilium-cli is from scratch only including cilium binaries | ||
ARG FINAL_CONTAINER="cilium-cli-ci" | ||
|
||
FROM docker.io/library/golang:1.23.2-alpine3.19@sha256:f6392ffebb028fed5ffe743ddb9716e38402c978779edd66474bb5d05f5e65e4 AS builder | ||
WORKDIR /go/src/github.com/cilium/cilium-cli | ||
RUN apk add --no-cache curl git make ca-certificates | ||
COPY . . | ||
RUN make | ||
|
||
# cilium-cli is from scratch only including cilium binaries | ||
FROM scratch AS cilium-cli | ||
ENTRYPOINT ["cilium"] | ||
LABEL maintainer="[email protected]" | ||
COPY --from=builder --chown=root:root --chmod=755 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /go/src/github.com/cilium/cilium-cli/cilium /usr/local/bin/cilium | ||
|
||
# cilium-cli-ci is based on ubuntu with cloud CLIs | ||
FROM ubuntu:24.04@sha256:99c35190e22d294cdace2783ac55effc69d32896daaa265f0bbedbcde4fbe3e5 AS cilium-cli-ci | ||
ENTRYPOINT [] | ||
LABEL maintainer="[email protected]" | ||
COPY --from=builder /go/src/github.com/cilium/cilium-cli/cilium /usr/local/bin/cilium | ||
|
||
# Install cloud CLIs. Based on these instructions: | ||
|
@@ -40,6 +39,4 @@ RUN apt-get update -y \ | |
&& rm -r ./aws awscliv2.zip \ | ||
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash | ||
|
||
FROM ${FINAL_CONTAINER} | ||
LABEL maintainer="[email protected]" | ||
WORKDIR /root/app |