refactor: update Dockerfile base image to Rocky Linux and remove obsolete workflow
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
name: Create and publish a Docker image for Linux
|
name: Create and publish a Docker image for Linux
|
||||||
on:
|
on:
|
||||||
- push
|
push:
|
||||||
- workflow_dispatch
|
tags:
|
||||||
|
- 'v*.*.*' # Run only when version tags are pushed
|
||||||
|
workflow_dispatch: # Keep manual trigger for testing
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: gitea.sjs.io
|
||||||
GITHUBUSER: ${{ github.repository_owner }}
|
GITHUBUSER: ${{ gitea.repository_owner }}
|
||||||
IMAGE_NAME: speedtest-cli
|
IMAGE_NAME: rocky-dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-image:
|
build-and-push-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -26,17 +30,19 @@ jobs:
|
|||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ vars.USERNAME }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.PASS }}
|
||||||
|
|
||||||
- name: Extract metadata for Docker
|
- name: Extract metadata for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ vars.USERNAME }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest
|
type=semver,pattern={{version}}
|
||||||
type=sha,format=short
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
- name: Build and push both architectures
|
- name: Build and push both architectures
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
33
Dockerfile
33
Dockerfile
@@ -1,20 +1,17 @@
|
|||||||
FROM alpine:latest
|
FROM rockylinux:9
|
||||||
|
|
||||||
RUN apk add --no-cache wget ca-certificates tar
|
RUN dnf update -y && \
|
||||||
|
dnf install -y \
|
||||||
|
iputils \
|
||||||
|
iproute \
|
||||||
|
iperf3 \
|
||||||
|
net-tools \
|
||||||
|
procps-ng \
|
||||||
|
wget \
|
||||||
|
which \
|
||||||
|
vim \
|
||||||
|
python3-pip && \
|
||||||
|
dnf group install -y "Development Tools" && \
|
||||||
|
dnf clean all
|
||||||
|
|
||||||
ARG TARGETARCH
|
CMD ["/bin/bash"]
|
||||||
|
|
||||||
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
|
||||||
ARCH="x86_64"; \
|
|
||||||
elif [ "$TARGETARCH" = "arm64" ]; then \
|
|
||||||
ARCH="aarch64"; \
|
|
||||||
fi && \
|
|
||||||
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
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
Reference in New Issue
Block a user