Skip to content

Commit

Permalink
Add latest tag as well
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdeme committed Dec 18, 2022
1 parent f95cfea commit 646ff51
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:

- name: Set image name as env var
if: steps.check_tag.outputs.tag_exists == 'false'
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository }}:${{ env.AWS_CLI_VERSION }}" >> $GITHUB_ENV
run: |
echo "IMAGE_NAME=ghcr.io/${{ github.repository }}:${{ env.AWS_CLI_VERSION }}" >> $GITHUB_ENV
echo "IMAGE_NAME_LATEST=ghcr.io/${{ github.repository }}:latest" >> $GITHUB_ENV
- name: Set up QEMU
if: steps.check_tag.outputs.tag_exists == 'false'
Expand All @@ -68,7 +70,9 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
images: |
${{ env.IMAGE_NAME }}
${{ env.IMAGE_NAME_LATEST }}
- name: Build the image
if: steps.check_tag.outputs.tag_exists == 'false'
Expand All @@ -80,7 +84,9 @@ jobs:
build-args: |
AWS_CLI_VERSION=${{ env.AWS_CLI_VERSION }}
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
tags: ${{ env.IMAGE_NAME }}
tags: |
${{ env.IMAGE_NAME }}
${{ env.IMAGE_NAME_LATEST }}
- name: Push tag
if: steps.check_tag.outputs.tag_exists == 'false'
Expand All @@ -96,6 +102,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ env.AWS_CLI_VERSION }}
tag: ${{ env.AWS_CLI_VERSION }}
makeLatest: true
skipIfReleaseExists: true
body: |
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# AWS CLI v2 built on Alpine

This repository contains the Dockerfile for building an AWS CLI v2 image based on Alpine.
Unfortunately this process is very slow, so we we separated this into its own repository. Other Alpine-based images can now simply pull in this binaries like so:
[![Publish 🚀](https://github.com/spacelift-io/aws-cli-alpine/actions/workflows/publish.yml/badge.svg)](https://github.com/spacelift-io/aws-cli-alpine/actions/workflows/publish.yml)

---

This repository contains the [Dockerfile](./Dockerfile) for building an [AWS CLI](https://github.com/aws/aws-cli) v2 image based on [Alpine](https://hub.docker.com/_/alpine).

As of December 2022, this process is extremely slow (building on ARM architecture takes around an hour), that's why we separated this process into its own repository.

Other Alpine-based images can now simply pull pre-built the binaries like so:

```dockerfile
COPY --from=ghcr.io/spacelift-io/awscliv2:2.9.8 /usr/local/aws-cli/ /usr/local/aws-cli/
Expand All @@ -10,9 +17,9 @@ COPY --from=ghcr.io/spacelift-io/awscliv2:2.9.8 /aws-cli-bin/ /usr/local/bin/

The newest releases can be found in the [Releases](https://github.com/spacelift-io/aws-cli-alpine/releases) section.

## Schedule & builds
> **Note:** As of December 2022, AWS CLI v2 [builds with PyInstaller 5.3](https://github.com/aws/aws-cli/blob/2.9.8/requirements-build.txt#L4). This version is only compatible with Python 3.9, that's why we use an older Python image.
The release process is automated and the image is published to GitHub Container Registry.
## Schedule & builds 📅

We check for the latest AWS CLI version in `tag_latest_version.yml` workflow periodically.
If a new version is found, we create a tag and `publish.yml` picks it up, builds it and published it to GitHub Container Registry.
We check for the latest AWS CLI version in `publish.yml` workflow periodically.
If a new version is found, we create a tag, then build and publish it to GitHub Container Registry.

0 comments on commit 646ff51

Please sign in to comment.