Skip to content

Commit

Permalink
Merge pull request #64 from rodrigo-oliveira-silva/feature/arch
Browse files Browse the repository at this point in the history
Feature/arch
  • Loading branch information
koslib committed Mar 20, 2024
2 parents 4d7c0ad + aa87a1c commit 1a33950
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
with:
push: true
context: "{{defaultContext}}:dockerhub"
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: koslib/ga-helm-eks:latest, koslib/ga-helm-eks:${{ github.event.inputs.tag }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# For contributors: in case someone would like to contribute a change in the base docker image,
# please open a PR for the `dockerhub/Dockerfile` in the same project.

FROM koslib/ga-helm-eks:2.5
#FROM koslib/ga-helm-eks:2.5
FROM koslib/ga-helm-eks:latest
42 changes: 29 additions & 13 deletions dockerhub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
FROM mozilla/sops:v3.6.0-alpine as sops
FROM --platform=${BUILDPLATFORM} alpine:3.18.4 AS Base

FROM alpine:3.13
# set build arguments automatically using buildx
ARG BUILDPLATFORM
ARG BUILDARCH

ARG AWSCLI_VERSION="1.24.0"
ARG HELM_VERSION="3.10.1"
ARG KUBECTL_VERSION="1.25.4"
ARG TARGETPLATFORM
ARG TARGETARCH

COPY --from=sops /usr/local/bin/sops /usr/bin/sops
ARG HELM_VERSION="3.13.2"
ARG KUBECTL_VERSION="1.28.4"

RUN apk add py-pip curl wget ca-certificates git bash jq gcc alpine-sdk
RUN pip install "awscli==${AWSCLI_VERSION}"
RUN curl -L -o /usr/bin/kubectl https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
RUN chmod +x /usr/bin/kubectl
RUN echo I am running on $BUILDPLATFORM $BUILDARCH, to target arch for $TARGETPLATFORM $TARGETARCH

# Download the binary
RUN wget https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.${TARGETARCH}
# Move the binary in to your PATH
RUN mv sops-v3.8.1.linux.${TARGETARCH} /usr/local/bin/sops
# Make the binary executable
RUN chmod +x /usr/local/bin/sops

RUN apk update

RUN apk add py-pip curl wget git bash jq gcc alpine-sdk openssl
RUN apk add --no-cache aws-cli
RUN apk --no-cache add ca-certificates && update-ca-certificates

RUN curl -o /usr/bin/aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator
RUN chmod +x /usr/bin/aws-iam-authenticator
RUN curl -L -o /usr/bin/kubectl https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl
RUN wget https://get.helm.sh/helm-v${HELM_VERSION}-linux-${TARGETARCH}.tar.gz -O - | tar -xzO linux-${TARGETARCH}/helm > /usr/local/bin/helm

RUN wget https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm
RUN chmod +x /usr/bin/kubectl
RUN chmod +x /usr/local/bin/helm


FROM base AS Exec

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
14 changes: 7 additions & 7 deletions dockerhub/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

set -e

Expand All @@ -17,12 +17,12 @@ then
done
fi

echo "running entrypoint command(s)"
echo "running entrypoint with command(s):"

response=$(bash -c "${INPUT_COMMAND}")
response=$(sh -c "$INPUT_COMMAND")

{
echo "response<<EOF";
echo "$response";
echo "EOF";
} >> "${GITHUB_OUTPUT}"
echo "response<<EOF"
echo "$response"
echo "EOF"
} >> "$GITHUB_OUTPUT"

0 comments on commit 1a33950

Please sign in to comment.