Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Rename ansible 9.5.1 variants to alpine 3.20 #58

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

# This step generates the docker tags
- name: Prepare
id: prep-9-5-1-alpine-edge
id: prep-9-5-1-alpine-3-20
run: |
set -e

Expand All @@ -92,7 +92,7 @@ jobs:
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="9.5.1-alpine-edge"
VARIANT="9.5.1-alpine-3.20"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"

Expand All @@ -102,52 +102,52 @@ jobs:
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT

- name: 9.5.1-alpine-edge - Build (PRs)
- name: 9.5.1-alpine-3.20 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/9.5.1-alpine-edge
context: variants/9.5.1-alpine-3.20
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: false
tags: |
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 9.5.1-alpine-edge - Build and push (master)
- name: 9.5.1-alpine-3.20 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/9.5.1-alpine-edge
context: variants/9.5.1-alpine-3.20
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 9.5.1-alpine-edge - Build and push (release)
- name: 9.5.1-alpine-3.20 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/9.5.1-alpine-edge
context: variants/9.5.1-alpine-3.20
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-edge.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-alpine-3-20.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-9-5-1-sops-ssh-alpine-edge
id: prep-9-5-1-sops-ssh-alpine-3-20
run: |
set -e

Expand All @@ -160,7 +160,7 @@ jobs:
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="9.5.1-sops-ssh-alpine-edge"
VARIANT="9.5.1-sops-ssh-alpine-3.20"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"

Expand All @@ -170,45 +170,45 @@ jobs:
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT

- name: 9.5.1-sops-ssh-alpine-edge - Build (PRs)
- name: 9.5.1-sops-ssh-alpine-3.20 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/9.5.1-sops-ssh-alpine-edge
context: variants/9.5.1-sops-ssh-alpine-3.20
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: false
tags: |
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 9.5.1-sops-ssh-alpine-edge - Build and push (master)
- name: 9.5.1-sops-ssh-alpine-3.20 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/9.5.1-sops-ssh-alpine-edge
context: variants/9.5.1-sops-ssh-alpine-3.20
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 9.5.1-sops-ssh-alpine-edge - Build and push (release)
- name: 9.5.1-sops-ssh-alpine-3.20 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/9.5.1-sops-ssh-alpine-edge
context: variants/9.5.1-sops-ssh-alpine-3.20
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-9-5-1-sops-ssh-alpine-3-20.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Dockerized `ansible` with useful tools.

| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:9.5.1-alpine-edge`, `:latest` | [View](variants/9.5.1-alpine-edge) |
| `:9.5.1-sops-ssh-alpine-edge` | [View](variants/9.5.1-sops-ssh-alpine-edge) |
| `:9.5.1-alpine-3.20`, `:latest` | [View](variants/9.5.1-alpine-3.20) |
| `:9.5.1-sops-ssh-alpine-3.20` | [View](variants/9.5.1-sops-ssh-alpine-3.20) |
| `:8.6.1-alpine-3.19` | [View](variants/8.6.1-alpine-3.19) |
| `:8.6.1-sops-ssh-alpine-3.19` | [View](variants/8.6.1-sops-ssh-alpine-3.19) |
| `:7.5.0-alpine-3.18` | [View](variants/7.5.0-alpine-3.18) |
Expand Down
2 changes: 1 addition & 1 deletion generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $local:VARIANTS_MATRIX = @(
package = 'ansible'
package_version = '9.5.1'
distro = 'alpine'
distro_version = 'edge'
distro_version = '3.20'
subvariants = @(
@{ components = @() }
@{ components = @( 'sops', 'ssh' ) }
Expand Down
16 changes: 16 additions & 0 deletions variants/9.5.1-alpine-3.20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.20
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=9.5.1; \
ansible --version

RUN apk add --no-cache ca-certificates

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/9.5.1-alpine-3.20/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
26 changes: 26 additions & 0 deletions variants/9.5.1-sops-ssh-alpine-3.20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.20
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=9.5.1; \
ansible --version

RUN apk add --no-cache ca-certificates

RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

RUN apk add --no-cache openssh-client

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/9.5.1-sops-ssh-alpine-3.20/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"