Skip to content

Commit

Permalink
Merge pull request #29 from Archisman-Mridha/main
Browse files Browse the repository at this point in the history
Supporting both ARM64 and AMD64 container images for backup-sealed-se…
  • Loading branch information
ashish1099 authored Jan 4, 2025
2 parents ceefcd9 + ad336d2 commit 0d8d625
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/backup-sealed-secrets-keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build backup-sealed-secrets-keys

on:
push:
branches: [ "*" ]
paths: 'backup-sealed-secrets-keys/**'
tags: [ "v*" ]
branches: ["*"]
paths: "backup-sealed-secrets-keys/**"
tags: ["v*"]

jobs:
build-and-push:
Expand Down Expand Up @@ -37,9 +37,12 @@ jobs:

- name: Build & push container image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
file: "./backup-sealed-secrets-keys/Dockerfile"
# NOTE : It takes pretty long to build container images for the ARM64 platform (even when
# using QEMU).
platforms: linux/amd64,linux/arm64
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
Expand Down
15 changes: 8 additions & 7 deletions backup-sealed-secrets-keys/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ RUN apt-get install -y jq gzip gnupg wget apt-transport-https ca-certificates un
RUN apt-get dist-upgrade -y

# Enable Google Kubernetes repo
RUN wget --quiet -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
RUN echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /" | tee /etc/apt/sources.list.d/kubernetes.list
RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg

# Enable Azure repo
RUN mkdir -p /etc/apt/keyrings
Expand All @@ -22,10 +22,11 @@ RUN apt-get update
RUN apt-get install -y kubectl --no-install-recommends

# Download and install AWS CLI v2
RUN wget --quiet https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
RUN unzip awscli-exe-linux-x86_64.zip
RUN aws/install
RUN rm -fr aws/ awscli-exe-linux-x86_64.zip
RUN export CPU_ARCHITECTURE=$([ "$(uname -m)" = "x86_64" ] && echo "x86_64" || echo "aarch64") &&\
wget https://awscli.amazonaws.com/awscli-exe-linux-"${CPU_ARCHITECTURE}".zip && \
unzip awscli-exe-linux-"${CPU_ARCHITECTURE}".zip && \
aws/install && \
rm -fr aws/ awscli-exe-linux-"${CPU_ARCHITECTURE}".zip

# Install AZURE cli
RUN apt-get install -y azure-cli --no-install-recommends
Expand All @@ -43,4 +44,4 @@ RUN mkdir /home/script
RUN chown 1000:1000 /home/script
USER 1000:1000

CMD ["/bin/bash", "/mnt/script"]
CMD ["/bin/bash", "/mnt/script"]

0 comments on commit 0d8d625

Please sign in to comment.