|
3 | 3 | # Copyright Authors of Cilium
|
4 | 4 | # SPDX-License-Identifier: Apache-2.0
|
5 | 5 |
|
| 6 | +# FINAL_CONTAINER specifies the source for the output |
| 7 | +# cilium-cli-ci (default) is based on ubuntu with cloud CLIs |
| 8 | +# cilium-cli is from scratch only including cilium binaries |
| 9 | +ARG FINAL_CONTAINER="cilium-cli-ci" |
| 10 | + |
6 | 11 | FROM docker.io/library/golang:1.23.1-alpine3.19@sha256:e0ea2a119ae0939a6d449ea18b2b1ba30b44986ec48dbb88f3a93371b4bf8750 AS builder
|
7 | 12 | WORKDIR /go/src/github.com/cilium/cilium-cli
|
8 | 13 | RUN apk add --no-cache curl git make ca-certificates
|
9 | 14 | COPY . .
|
10 | 15 | RUN make
|
11 | 16 |
|
12 |
| -FROM ubuntu:24.04@sha256:dfc10878be8d8fc9c61cbff33166cb1d1fe44391539243703c72766894fa834a |
13 |
| -LABEL maintainer= "[email protected]" |
14 |
| -WORKDIR /root/app |
| 17 | +FROM scratch AS cilium-cli |
| 18 | +COPY --from=builder /go/src/github.com/cilium/cilium-cli/cilium /usr/local/bin/cilium |
| 19 | + |
| 20 | +FROM ubuntu:24.04@sha256:dfc10878be8d8fc9c61cbff33166cb1d1fe44391539243703c72766894fa834a AS cilium-cli-ci |
15 | 21 | COPY --from=builder /go/src/github.com/cilium/cilium-cli/cilium /usr/local/bin/cilium
|
16 | 22 |
|
17 | 23 | # Install cloud CLIs. Based on these instructions:
|
18 | 24 | # - https://cloud.google.com/sdk/docs/install#deb
|
19 | 25 | # - https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
|
20 | 26 | # - https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#install-azure-cli
|
21 | 27 | RUN apt-get update -y \
|
22 |
| - && apt-get install -y curl gnupg unzip \ |
23 |
| - && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \ |
24 |
| - && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \ |
25 |
| - && echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \ |
26 |
| - && apt-get update -y \ |
27 |
| - && apt-get install -y google-cloud-cli google-cloud-sdk-gke-gcloud-auth-plugin kubectl \ |
28 |
| - && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ |
29 |
| - && unzip awscliv2.zip \ |
30 |
| - && ./aws/install \ |
31 |
| - && rm -r ./aws awscliv2.zip \ |
32 |
| - && curl -sL https://aka.ms/InstallAzureCLIDeb | bash |
| 28 | + && apt-get install -y curl gnupg unzip \ |
| 29 | + && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \ |
| 30 | + && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \ |
| 31 | + && echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \ |
| 32 | + && apt-get update -y \ |
| 33 | + && apt-get install -y google-cloud-cli google-cloud-sdk-gke-gcloud-auth-plugin kubectl \ |
| 34 | + && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ |
| 35 | + && unzip awscliv2.zip \ |
| 36 | + && ./aws/install \ |
| 37 | + && rm -r ./aws awscliv2.zip \ |
| 38 | + && curl -sL https://aka.ms/InstallAzureCLIDeb | bash |
33 | 39 |
|
34 |
| -ENTRYPOINT [] |
| 40 | +FROM ${FINAL_CONTAINER} |
| 41 | +LABEL maintainer= "[email protected]" |
| 42 | +WORKDIR /root/app |
| 43 | +ENTRYPOINT ["/usr/local/bin/cilium"] |
0 commit comments