Skip to content

Commit

Permalink
Fix aws-cli on alpine, consolidate configs
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafonseca committed Jul 18, 2022
1 parent b3d859a commit 13d0bec
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 85 deletions.
54 changes: 4 additions & 50 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,11 @@ jobs:
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Build the Docker image
run: docker build . --file Dockerfile --tag tfgco/kubectl:latest
run: docker build . --file Dockerfile --tag tfgco/kubectl:latest --tag tfgco/kubectl:${{steps.vars.outputs.tag}} --tag tfgco/kubectl:aws-cli --tag tfgco/kubectl:${{steps.vars.outputs.tag}}-aws-cli
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Push the latest Docker image
run: docker push tfgco/kubectl:latest
- name: Tag the release Docker image
run: docker tag tfgco/kubectl:latest tfgco/kubectl:${{steps.vars.outputs.tag}}
- name: Push the tagged release Docker image
run: docker push tfgco/kubectl:${{steps.vars.outputs.tag}}
dockerhub-build-push-awscli:
name: DockerHub Build and Push - aws-cli
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get the current release version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Build the aws-cli Docker image
run: docker build . --file Dockerfile-aws-cli --tag tfgco/kubectl:aws-cli
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Push the latest aws-cli Docker image
run: docker push tfgco/kubectl:aws-cli
- name: Tag the release aws-cli Docker image
run: docker tag tfgco/kubectl:aws-cli tfgco/kubectl:${{steps.vars.outputs.tag}}-aws-cli
- name: Push the tagged release aws-cli Docker image
run: docker push tfgco/kubectl:${{steps.vars.outputs.tag}}-aws-cli
run: docker push --all-tags tfgco/kubectl:latest
quayio-build-push:
name: Quay.io Build and Push
runs-on: ubuntu-latest
Expand All @@ -53,31 +30,8 @@ jobs:
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Build the Docker image
run: docker build . --file Dockerfile --tag quay.io/tfgco/kubectl:latest
run: docker build . --file Dockerfile --tag quay.io/tfgco/kubectl:latest --tag quay.io/tfgco/kubectl:${{steps.vars.outputs.tag}} --tag quay.io/tfgco/kubectl:aws-cli --tag quay.io/tfgco/kubectl:${{steps.vars.outputs.tag}}-aws-cli
- name: Login to Quay.io Registry
run: echo ${{ secrets.QUAYIO_TOKEN }} | docker login -u ${{ secrets.QUAYIO_USERNAME }} --password-stdin quay.io
- name: Push the latest Docker image
run: docker push quay.io/tfgco/kubectl:latest
- name: Tag the release Docker image
run: docker tag quay.io/tfgco/kubectl:latest quay.io/tfgco/kubectl:${{steps.vars.outputs.tag}}
- name: Push the tagged release Docker image
run: docker push quay.io/tfgco/kubectl:${{steps.vars.outputs.tag}}
quayio-build-push-awscli:
name: Quay.io Build and Push - aws-cli
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get the current release version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Build the aws-cli Docker image
run: docker build . --file Dockerfile-aws-cli --tag quay.io/tfgco/kubectl:aws-cli
- name: Login to Quay.io Registry
run: echo ${{ secrets.QUAYIO_TOKEN }} | docker login -u ${{ secrets.QUAYIO_USERNAME }} --password-stdin quay.io
- name: Push the latest aws-cli Docker image
run: docker push quay.io/tfgco/kubectl:aws-cli
- name: Tag the release aws-cli Docker image
run: docker tag quay.io/tfgco/kubectl:aws-cli quay.io/tfgco/kubectl:${{steps.vars.outputs.tag}}-aws-cli
- name: Push the tagged release aws-cli Docker image
run: docker push quay.io/tfgco/kubectl:${{steps.vars.outputs.tag}}-aws-cli
run: docker push --all-tags quay.io/tfgco/kubectl:latest
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
FROM python:3.10.5-alpine3.16 as builder

ENV AWS_CLI_VERSION=2.7.16

RUN set -ex; \
apk add --no-cache \
git unzip groff build-base libffi-dev cmake

RUN set -eux; \
git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git; \
cd /aws-cli; \
sed -i'' 's/PyInstaller.*/PyInstaller==5.2/g' requirements-build.txt; \
python -m venv venv; \
. venv/bin/activate; \
./scripts/installers/make-exe

RUN set -ex; \
unzip /aws-cli/dist/awscli-exe.zip; \
./aws/install --bin-dir /aws-cli-bin; \
/aws-cli-bin/aws --version

FROM alpine:3.16.0

LABEL maintainer="Wildlife Studios"
Expand Down Expand Up @@ -29,5 +50,8 @@ RUN curl https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz --output -
&& chmod +x /bin/helm \
&& rm -rf /tmp/linux-amd64

COPY --from=builder /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=builder /aws-cli-bin/ /usr/local/bin/

ENTRYPOINT [ "/bin/bash", "-c" ]
CMD [ "bash" ]
35 changes: 0 additions & 35 deletions Dockerfile-aws-cli

This file was deleted.

0 comments on commit 13d0bec

Please sign in to comment.