Skip to content

Commit 0ab0a2f

Browse files
authored
Use proper BASE_IMAGE in contributed recipes for forks (#2284)
* Use proper BASE_IMAGE in contributed recipes for forks * Fix * Ony more try * Longer fix * Better wording
1 parent 90224a7 commit 0ab0a2f

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/contributed-recipes.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Test the contributed recipes
22

3+
env:
4+
REGISTRY: quay.io
5+
OWNER: ${{ github.repository_owner }}
6+
37
on:
48
schedule:
59
# Images are rebuilt at 03:00 on Monday UTC
@@ -61,8 +65,31 @@ jobs:
6165
variant: default
6266

6367
# Not pulling the image, because it might be loaded from previous step or will be downloaded automatically
64-
- name: Build recipe 🛠
65-
run: docker build --rm --force-rm --tag my-custom-image -f ./${{ matrix.dockerfile }} ./
68+
- name: Build recipe with parent image 🛠
69+
if: ${{ matrix.parent-image != '' }}
70+
run: |
71+
docker build \
72+
--rm --force-rm \
73+
--tag my-custom-image \
74+
-f ./${{ matrix.dockerfile }} \
75+
--build-arg BASE_IMAGE=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.parent-image }} \
76+
./
77+
env:
78+
DOCKER_BUILDKIT: 1
79+
# Full logs for CI build
80+
BUILDKIT_PROGRESS: plain
81+
working-directory: docs/using/recipe_code
82+
shell: bash
83+
84+
# Not pulling the image, because it might be loaded from previous step or will be downloaded automatically
85+
- name: Build recipe without parent image 🛠
86+
if: ${{ matrix.parent-image == '' }}
87+
run: |
88+
docker build \
89+
--rm --force-rm \
90+
--tag my-custom-image \
91+
-f ./${{ matrix.dockerfile }} \
92+
./
6693
env:
6794
DOCKER_BUILDKIT: 1
6895
# Full logs for CI build

docs/using/custom-images.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Our repository provides several customization points:
2020
- `REGISTRY`, `OWNER`, `BASE_IMAGE` (docker arguments) - they allow to specify parent image for all the other images
2121
- `REGISTRY`, `OWNER` (part of `env` in some GitHub workflows) - these allow to properly tag and refer to images during following steps:
2222
- [`build-test-upload`](https://github.com/jupyter/docker-stacks/blob/main/.github/workflows/docker-build-test-upload.yml)
23+
- [`contributed-recipes`](https://github.com/jupyter/docker-stacks/blob/main/.github/workflows/contributed-recipes.yml)
2324
- [`tag-push`](https://github.com/jupyter/docker-stacks/blob/main/.github/workflows/docker-tag-push.yml)
2425

2526
These customization points can't be changed during runtime.

0 commit comments

Comments
 (0)