File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ name: Publish Docker image
1111
1212on :
1313 push :
14- branches : [main]
14+ branches :
15+ - ' main'
16+ tags :
17+ - ' *'
1518
1619jobs :
1720 push_to_registry :
2124 - name : Check out the repo
2225 uses : actions/checkout@v4
2326
27+ - name : Set up QEMU
28+ uses : docker/setup-qemu-action@v3
29+
30+ - name : Set up Docker Buildx
31+ uses : docker/setup-buildx-action@v3
32+
2433 - name : Log in to Docker Hub
2534 uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
2635 with :
@@ -32,12 +41,18 @@ jobs:
3241 uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3342 with :
3443 images : kodermax/kubectl-aws-eks
44+ tags : |
45+ type=semver,pattern={{version}}
46+ type=semver,pattern={{major}}.{{minor}}
47+ type=semver,pattern={{major}}
48+ type=ref,event=branch
3549
3650 - name : Build and push Docker image
3751 uses : docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
3852 with :
3953 context : .
4054 file : ./Dockerfile
4155 push : true
42- tags : kodermax/kubectl-aws-eks:latest
56+ tags : ${{ steps.meta.outputs.tags }}
4357 labels : ${{ steps.meta.outputs.labels }}
58+ platforms : linux/amd64,linux/arm64
Original file line number Diff line number Diff line change 11FROM amazon/aws-cli:latest
2+ ARG TARGETARCH
3+ ARG JQ_VERSION=1.6
4+ ARG IAM_VERSION=0.6.12
25
36# Install system packages and jq first
4- RUN yum update -y && \
5- yum install -y coreutils && \
6- curl -sL -o /usr/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 && \
7+ RUN dnf update -y && \
8+ dnf install --allowerasing -y coreutils && \
9+ rm /var/cache/dnf/*.solv* && \
10+ curl -sL -o /usr/bin/jq https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-linux-${TARGETARCH} && \
711 chmod +x /usr/bin/jq
812
913# Install kubectl and aws-iam-authenticator
10- RUN curl -sL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64 /kubectl && \
11- curl -sL -o /usr/bin/aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.6.12 /aws-iam-authenticator_0.6.12_linux_amd64 && \
14+ RUN curl -sL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${TARGETARCH} /kubectl && \
15+ curl -sL -o /usr/bin/aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_VERSION} /aws-iam-authenticator_${IAM_VERSION}_linux_${TARGETARCH} && \
1216 chmod +x /usr/bin/aws-iam-authenticator && \
1317 chmod +x /usr/bin/kubectl
1418
You can’t perform that action at this time.
0 commit comments