From 88e08c5b5a5934d61af2ffaac59283876b50551e Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Thu, 22 Jun 2023 21:16:55 -0700 Subject: [PATCH] Pass in base image name as an argument. --- .github/workflows/dockerhub.yml | 3 +++ docker/Dockerfile | 3 ++- docker/Dockerfile.push | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index dec25b9bf..8600aa381 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -3,6 +3,7 @@ on: [push, pull_request] env: PLATFORMS: linux/amd64,linux/i386,linux/arm/v7,linux/arm64 + BASE_IMAGE: debian:12-slim jobs: check_disabled_actions: @@ -63,6 +64,7 @@ jobs: with: context: . file: ./docker/Dockerfile + build-args: BASE_IMAGE=${{ env.BASE_IMAGE }} tags: | ${{ steps.meta.outputs.tags }} sippylabs/rtpproxy:${{ github.sha }} @@ -75,6 +77,7 @@ jobs: with: context: . file: ./docker/Dockerfile.push + build-args: BASE_IMAGE=${{ env.BASE_IMAGE }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 5aa489e66..220d2dd75 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,5 @@ -FROM --platform=$TARGETPLATFORM debian:12-slim as build +ARG BASE_IMAGE +FROM --platform=$TARGETPLATFORM $BASE_IMAGE as build LABEL maintainer="Maksym Sobolyev " USER root diff --git a/docker/Dockerfile.push b/docker/Dockerfile.push index e65518122..6e9eac069 100644 --- a/docker/Dockerfile.push +++ b/docker/Dockerfile.push @@ -1,4 +1,5 @@ -FROM --platform=$TARGETPLATFORM debian:12-slim as build +ARG BASE_IMAGE +FROM --platform=$TARGETPLATFORM $BASE_IMAGE as build LABEL maintainer="Maksym Sobolyev " USER root @@ -18,5 +19,5 @@ RUN ls -l /usr/local/lib/*rtpproxy* WORKDIR / RUN rm -rf /rtpproxy && rm -rf /var/cache/* -FROM --platform=$TARGETPLATFORM debian:12-slim +FROM --platform=$TARGETPLATFORM $BASE_IMAGE COPY --from=build / /