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:
27
.github/workflows/docker-image-linux.yml
vendored
27
.github/workflows/docker-image-linux.yml
vendored
@@ -29,12 +29,33 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push amd64
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64
|
||||||
|
build-args: |
|
||||||
|
ARCH=x86_64
|
||||||
tags: |
|
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
|
||||||
12
Dockerfile
12
Dockerfile
@@ -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
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Set terminal type
|
# Set terminal type
|
||||||
export TERM=xterm-256color
|
export TERM=xterm-256color
|
||||||
|
|||||||
Reference in New Issue
Block a user