forked from dag-andersen/argocd-diff-preview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_ARM64
49 lines (36 loc) · 1.54 KB
/
Dockerfile_ARM64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM rust:1-slim-buster as build
# create a new empty shell project
RUN USER=root cargo new --bin argocd-diff-preview
WORKDIR /argocd-diff-preview
# copy over your manifests
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
# this build step will cache your dependencies
RUN cargo build --release
RUN rm src/*.rs
# copy your source tree
COPY ./src ./src
# install kind
RUN apt-get update && apt-get install -y curl
RUN curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-arm64
RUN chmod +x ./kind
# Install kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/arm64/kubectl \
&& chmod +x ./kubectl
# Install Argo CD
RUN curl -sSL -o argocd-linux-arm64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-arm64
RUN install -m 555 argocd-linux-arm64 /usr/local/bin/argocd
RUN rm argocd-linux-arm64
# build for release
RUN rm ./target/release/deps/argocd_diff_preview-*
RUN cargo build --release
# our final base
FROM rust:1-slim-bookworm
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
COPY --from=build /argocd-diff-preview/kind /usr/local/bin/kind
COPY --from=build /argocd-diff-preview/kubectl /usr/local/bin/kubectl
COPY --from=build /usr/local/bin/argocd /usr/local/bin/argocd
COPY --from=build /argocd-diff-preview/target/release/argocd-diff-preview .
RUN apt-get update && apt-get install -y git
# set the startup command to run your binary
ENTRYPOINT ["./argocd-diff-preview"]