Skip to content

Commit

Permalink
Add Alpine 3.20
Browse files Browse the repository at this point in the history
  • Loading branch information
tiredofit committed May 22, 2024
1 parent 56343d8 commit f54b4be
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 6 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,113 @@ jobs:
build-args: |
ALPINE_VERSION=${{ env.DISTRO_VARIANT }}
###
v3_20:
env:
DISTRO_VARIANT: "3.20"
build_file: Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
id: prep
run: |
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")"
else
git_branch=${GITHUB_REF#refs/heads/}
fi
case "${git_branch}" in
"main" | "master" )
if [ "${{ vars.LATEST }}" = "TRUE" ] || [ "${{ vars.LATEST }}" = "${DISTRO_VARIANT}" ]; then
image_latest=",${GITHUB_REPOSITORY}:latest"
fi
branch_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT},${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-latest${image_latest}"
;;
"develop" )
branch_tag="${GITHUB_REPOSITORY}:develop"
;;
esac
fi
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')"
fi
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then
image_tags=${branch_tag},${git_tag}
else
image_tags="${branch_tag}${git_tag}"
fi
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g")
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g")
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT
- name: Label
id: Label
run: |
image_name=${GITHUB_REPOSITORY/docker-/}
if [ -f "${{ env.build_file }}" ] ; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }}
if [ -f "CHANGELOG.md" ] ; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }}
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md
fi
if [[ $GITHUB_REF == refs/tags/* ]]; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }}
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }}
fi
fi
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm,arm64

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./${{ env.build_file }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.prep.outputs.container_images }}
build-args: |
ALPINE_VERSION=${{ env.DISTRO_VARIANT }}
###
v3_18:
Expand Down
111 changes: 110 additions & 1 deletion .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,116 @@ jobs:
ALPINE_VERSION=${{ env.DISTRO_VARIANT }}
###
v3_19:
v3_20:
env:
DISTRO_VARIANT: "3.20"
build_file: Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
id: prep
run: |
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")"
else
git_branch=${GITHUB_REF#refs/heads/}
fi
case "${git_branch}" in
"main" | "master" )
if [ "${{ vars.LATEST }}" = "TRUE" ] || [ "${{ vars.LATEST }}" = "${DISTRO_VARIANT}" ]; then
image_latest=",${GITHUB_REPOSITORY}:latest"
fi
branch_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT},${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-latest${image_latest}"
;;
"develop" )
branch_tag="${GITHUB_REPOSITORY}:develop"
;;
esac
fi
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')"
fi
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then
image_tags=${branch_tag},${git_tag}
else
image_tags="${branch_tag}${git_tag}"
fi
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g")
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g")
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT
- name: Label
id: Label
run: |
image_name=${GITHUB_REPOSITORY/docker-/}
if [ -f "${{ env.build_file }}" ] ; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }}
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }}
if [ -f "CHANGELOG.md" ] ; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }}
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md
fi
if [[ $GITHUB_REF == refs/tags/* ]]; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }}
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }}
fi
fi
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm,arm64

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./${{ env.build_file }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.prep.outputs.container_images }}
build-args: |
ALPINE_VERSION=${{ env.DISTRO_VARIANT }}
###
v3_19:
env:
DISTRO_VARIANT: "3.19"
build_file: Dockerfile
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG ALPINE_VERSION=3.19
ARG ALPINE_VERSION=3.20

FROM docker.io/alpine:${ALPINE_VERSION}
LABEL maintainer="Dave Conroy (github.com/tiredofit)"
Expand Down Expand Up @@ -38,7 +38,7 @@ RUN case "$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f
esac ; \
\
case "$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f 1,2 | cut -d _ -f 1)" in \
3.11 | 3.12 | 3.13 | 3.14 | 3.15 | 3.16 | 3.17* | 3.18* | 3.19* | 3.20* | edge ) zabbix_args=" --enable-agent2 " ; zabbix_agent2=true ; fluentbit_make=true ; echo "** Building Zabbix Agent 2" ; echo "** Building Fluent Bit" ;; \
3.11 | 3.12 | 3.13 | 3.14 | 3.15 | 3.16 | 3.17* | 3.18* | 3.19* | 3.20* | 3.21* | edge ) zabbix_args=" --enable-agent2 " ; zabbix_agent2=true ; fluentbit_make=true ; echo "** Building Zabbix Agent 2" ; echo "** Building Fluent Bit" ;; \
*) : ;; \
esac ; \
case "$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f 1,2 | cut -d _ -f 1)" in \
Expand All @@ -52,12 +52,12 @@ RUN case "$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f
esac ; \
case "$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f 1,2 | cut -d _ -f 1)" in \
3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 | 3.15 | 3.16 ) fts=fts ;; \
3.17 | 3.18* | 3.19* | 3.20* ) fts=musl-fts ;; \
3.17 | 3.18* | 3.19* | 3.20* | 3.21* ) fts=musl-fts ;; \
*) : ;; \
esac ; \
case "$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f 1,2 | cut -d _ -f 1)" in \
3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 | 3.15 | 3.16 ) alpine_ssl=libressl ;; \
3.17* | 3.18* | 3.19* | 3.20* ) alpine_ssl=openssl ;; \
3.17* | 3.18* | 3.19* | 3.20* | 3.21* ) alpine_ssl=openssl ;; \
*) : ;; \
esac ; \
\
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Dockerfile to build an [alpine](https://www.alpinelinux.org/) linux container image.

* Currently tracking 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, 3.16, 3.17, 3.18 , 3.19 and edge.
* Currently tracking 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, 3.16, 3.17, 3.18 , 3.19, 3.20 and edge.
* [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 init capabilities.
* [zabbix-agent](https://zabbix.org) (Classic and Modern) for individual container monitoring.
* Scheduling via cron with other helpful tools (bash, curl, less, logrotate, nano, vi) for easier management.
Expand Down Expand Up @@ -95,6 +95,7 @@ The following image tags are available along with their tagged release based on
| Alpine version | Tag |
| -------------- | ------- |
| `edge` | `:edge` |
| `3.20` | `:3.20` |
| `3.19` | `:3.19` |
| `3.18` | `:3.18` |
| `3.17` | `:3.17` |
Expand Down

0 comments on commit f54b4be

Please sign in to comment.