Skip to content

Commit

Permalink
Pass in base image name as an argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jun 23, 2023
1 parent e30aad7 commit 88e08c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

USER root
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.push
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

USER root
Expand All @@ -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 / /

0 comments on commit 88e08c5

Please sign in to comment.