From 54f7015989218c79d1e1d0b3c2fb3bba686308d8 Mon Sep 17 00:00:00 2001 From: Benjamin Golinvaux Date: Fri, 29 Nov 2024 17:54:06 +0100 Subject: [PATCH 1/3] Added environment variable (with default) to customize the container base image --- Dockerfile | 4 ++-- action.yml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d83e13d..1ac9e03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM alpine:3.19 +FROM ${BASE_IMAGE} RUN apk update \ && apk add --no-cache bash curl git -COPY rootfs/ / \ No newline at end of file +COPY rootfs/ / diff --git a/action.yml b/action.yml index 3c4f7b4..4575eac 100644 --- a/action.yml +++ b/action.yml @@ -29,10 +29,15 @@ inputs: description: '[Internal] The location to store the mutex repo' required: false default: '/run/gh-action-mutex/repo' + base_image: + description: 'The base image to use for the docker container (for instance, to use another registry)' + required: false + default: 'alpine:3.19' runs: using: 'docker' image: 'Dockerfile' env: + ARG_BASE_IMAGE: ${{ inputs.base_image }} ARG_BRANCH: ${{ inputs.branch }} ARG_CHECKOUT_LOCATION: ${{ inputs.internal_checkout-location }} ARG_GITHUB_SERVER: ${{ inputs.github_server }} From 79b697a9f8512892e2f6498bb8bb6fbf419c7090 Mon Sep 17 00:00:00 2001 From: Benjamin Golinvaux Date: Fri, 29 Nov 2024 18:50:20 +0100 Subject: [PATCH 2/3] fixing base image --- Dockerfile | 2 +- action.yml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ac9e03..5196fc3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ${BASE_IMAGE} +FROM ${ARG_BASE_IMAGE} RUN apk update \ && apk add --no-cache bash curl git diff --git a/action.yml b/action.yml index 4575eac..ed81f15 100644 --- a/action.yml +++ b/action.yml @@ -35,9 +35,11 @@ inputs: default: 'alpine:3.19' runs: using: 'docker' - image: 'Dockerfile' + build: + dockerfile: Dockerfile + args: + BASE_IMAGE: ${{ inputs.base_image }} env: - ARG_BASE_IMAGE: ${{ inputs.base_image }} ARG_BRANCH: ${{ inputs.branch }} ARG_CHECKOUT_LOCATION: ${{ inputs.internal_checkout-location }} ARG_GITHUB_SERVER: ${{ inputs.github_server }} From 2fe045014064e3bda2f071f3f32921572404dd19 Mon Sep 17 00:00:00 2001 From: Benjamin Golinvaux Date: Fri, 29 Nov 2024 19:20:55 +0100 Subject: [PATCH 3/3] Tentative fix --- action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index ed81f15..4575eac 100644 --- a/action.yml +++ b/action.yml @@ -35,11 +35,9 @@ inputs: default: 'alpine:3.19' runs: using: 'docker' - build: - dockerfile: Dockerfile - args: - BASE_IMAGE: ${{ inputs.base_image }} + image: 'Dockerfile' env: + ARG_BASE_IMAGE: ${{ inputs.base_image }} ARG_BRANCH: ${{ inputs.branch }} ARG_CHECKOUT_LOCATION: ${{ inputs.internal_checkout-location }} ARG_GITHUB_SERVER: ${{ inputs.github_server }}