Refactor Docker setup to support multi-architecture builds and update base image to Alpine

Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
Stephen Simpson
2025-03-20 09:04:10 -05:00
parent 7a4f31ec7e
commit a05a8835f4
3 changed files with 34 additions and 7 deletions

View File

@@ -29,12 +29,33 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
- name: Build and push amd64
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
build-args: |
ARCH=x86_64
tags: |
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:amd64
- name: Build and push arm64
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/arm64
build-args: |
ARCH=aarch64
tags: |
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:arm64
- name: Create and push manifest
run: |
docker manifest create ${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:latest \
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:amd64 \
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:latest

View File

@@ -1,8 +1,14 @@
FROM rockylinux/rockylinux:8.4
FROM alpine:latest
RUN curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | bash
# Set architecture as a build argument with a default value
ARG ARCH=x86_64
RUN yum -y install speedtest
RUN apk add --no-cache wget ca-certificates tar
RUN wget -q https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-${ARCH}.tgz && \
tar -xzf ookla-speedtest-1.2.0-linux-${ARCH}.tgz -C /usr/bin && \
rm ookla-speedtest-1.2.0-linux-${ARCH}.tgz && \
chmod +x /usr/bin/speedtest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Set terminal type
export TERM=xterm-256color