Skip to content

Commit ab15b8c

Browse files
committed
Add local registry for sharing between buildx jobs
1 parent 083dba1 commit ab15b8c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/build.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ jobs:
1212
build:
1313
name: Build snekbox-integration image
1414
runs-on: ubuntu-latest
15+
services:
16+
registry:
17+
image: registry:2
18+
ports:
19+
- 5000:5000
1520
outputs:
1621
artifact: ${{ env.artifact }}
1722
version: ${{ steps.version.outputs.version }}
@@ -38,6 +43,8 @@ jobs:
3843
# the builds. See https://github.com/docker/build-push-action
3944
- name: Set up Docker Buildx
4045
uses: docker/setup-buildx-action@v3
46+
with:
47+
driver-opts: network=host
4148

4249
- name: Log in to GitHub Container Registry
4350
uses: docker/login-action@v3
@@ -78,15 +85,15 @@ jobs:
7885
with:
7986
context: .
8087
file: ./Dockerfile
81-
push: false
88+
push: true
8289
target: venv
8390
build-args: DEV=1
8491
cache-from: |
8592
${{ steps.cache_config.outputs.cache_from }}
8693
ghcr.io/python-discord/snekbox-base:latest
8794
ghcr.io/python-discord/snekbox-venv:latest
8895
cache-to: ${{ steps.cache_config.outputs.cache_to }}
89-
tags: snekbox-venv:${{ steps.version.outputs.version }}
96+
tags: localhost:5000/local/snekbox-venv:${{ steps.version.outputs.version }}
9097

9198
- name: Build integration image for testing
9299
uses: docker/build-push-action@v6
@@ -96,9 +103,7 @@ jobs:
96103
push: false
97104
pull: false
98105
outputs: type=docker,dest=${{ env.artifact }}.tar
99-
build-args: SNEKBOX_IMAGE=snekbox-venv
100-
build-contexts: |
101-
snekbox-venv=docker-image://snekbox-venv:${{ steps.version.outputs.version }}
106+
build-args: SNEKBOX_IMAGE=localhost:5000/local/snekbox-venv:${{ steps.version.outputs.version }}
102107
cache-from: |
103108
${{ steps.cache_config.outputs.cache_from }}
104109
ghcr.io/python-discord/snekbox-venv:latest

0 commit comments

Comments
 (0)