Skip to content

Commit

Permalink
Merge pull request #837 from b-ehlers/docker_workflow
Browse files Browse the repository at this point in the history
Docker build: Simplify definition of DOCKER_REPOSITORY
  • Loading branch information
grossmj authored Oct 26, 2023
2 parents f2bb650 + 8b2250b commit 1667e14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/bin/docker_build
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def needs_rebuild(image, default_repository=None):
if base_name not in image_info:
image_info[base_name] = get_time_layers(base_name)
if not image_info[base_name]:
sys.exit(f"Missing base image: {base_name}")
sys.exit(f"{image['name']}: Missing base image: {base_name}")

# get information of image, if unknown
if full_name not in image_info:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ jobs:
- name: Build and push images
env:
# DOCKER_REPOSITORY - Repository for name-only images
# DockerHub:
#DOCKER_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
# GitHub Container Registry:
#DOCKER_REPOSITORY: ghcr.io/${{ github.repository_owner }}
# Both DockerHub and GitHub Container Registry:
DOCKER_REPOSITORY: >-
# Using multiple repositories will build images in all of them.
DOCKER_REPOSITORY: |
# DockerHub:
${{ secrets.DOCKERHUB_REPOSITORY }}
# GitHub Container Registry:
ghcr.io/${{ github.repository_owner }}
#
# Variables whose name are starting with "DOCKER_LOGIN"
Expand All @@ -90,6 +88,7 @@ jobs:
#
IMAGES: ${{ inputs.images }}
run: |
DOCKER_REPOSITORY=$(echo "$DOCKER_REPOSITORY" | sed '/^#/d')
set -f
set -- $IMAGES
set +f
Expand Down

0 comments on commit 1667e14

Please sign in to comment.