diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0d91c6f1b527aac4ccab018d67a4ffa65d45513f..a8e5bd76cf5490781a26522c9aca18628d896443 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,7 @@ stages:
- release
+
.build:
stage: build
tags: [docker]
@@ -13,10 +14,12 @@ stages:
- >-
/kaniko/executor
--cache=false
- --target "${BUILD_TARGET}"
+ --skip-unused-stages
+ --target ${BUILD_TARGET}
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-${BUILD_TARGET}"
+ --label org.opencontainers.image.authors="$LABEL_AUTHORS"
--label org.opencontainers.image.created="$(date -u -Iseconds)"
--label org.opencontainers.image.revision="$CI_COMMIT_SHA"
--label org.opencontainers.image.source="$CI_PROJECT_URL"
@@ -32,20 +35,22 @@ build:iperf3:
BUILD_TARGET: iperf3
+
.release:
stage: release
tags: [docker]
image:
name: gcr.io/go-containerregistry/crane:debug
entrypoint: ['']
+ rules:
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
- - crane auth login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+ - crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
release:iperf2:
extends: .release
needs: ['build:iperf2']
script:
- - crane tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-iperf2 2.2.0
- crane tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-iperf2 2.2
- crane tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-iperf2 2
@@ -53,9 +58,7 @@ release:iperf3:
extends: .release
needs: ['build:iperf3']
script:
- - crane tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-iperf3 3.17.1
- crane tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-iperf3 3.17
- crane tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-iperf3 3
-
# vi: set ts=2 sw=2 et ft=yaml:
diff --git a/Dockerfile b/Dockerfile
index ae405d8e77ca052e609ae13276e1e624e88947da..9500be0cb6a75bc183b87101197ca6b4361042c1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,18 +1,16 @@
-FROM alpine:3.21 AS base
-LABEL org.opencontainers.image.authors="Chris Coley <chris@codingallnight.com>"
-
# iPerf 2 image
-FROM base AS iperf2
-ENV IPERF_VERSION="2.2.0-r0"
-RUN apk add --no-cache iperf=${IPERF_VERSION}
-ENTRYPOINT ["iperf", "-s"]
+FROM alpine:3.21 AS iperf2
+RUN apk add --no-cache iperf=~2.2
+ENTRYPOINT ["iperf"]
+CMD ["-s"]
EXPOSE 5001/tcp 5001/udp
+
# iPerf 3 image
-FROM base AS iperf3
-ENV IPERF_VERSION="3.17.1-r0"
-RUN apk add --no-cache iperf3=${IPERF_VERSION}
-ENTRYPOINT ["iperf3", "-s"]
+FROM alpine:3.21 AS iperf3
+RUN apk add --no-cache iperf3=~3.17
+ENTRYPOINT ["iperf3"]
+CMD ["-s"]
EXPOSE 5201/tcp 5201/udp
# vi: set ts=4 sw=4 et ft=dockerfile: