Skip to content

Commit

Permalink
chore: restore load-image-json
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Feb 13, 2025
1 parent 220331d commit 6130748
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions transport-interop/impl/js/v1.x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ image_name := js-v1.x
# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in
all: image.json chromium-image.json firefox-image.json update-lock-file

# Necessary because multistage builds require a docker image name rather than a digest to be used
load-image-json: image.json
docker image tag $$(jq -r .imageID image.json) ${image_name}

image.json:
docker builder prune -af
docker build -t node-${image_name} -f ./Dockerfile .
docker image inspect node-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

chromium-image.json: image.json
chromium-image.json: load-image-json
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=node-${image_name} --build-arg=BROWSER=chromium -t chromium-${image_name} .
docker image inspect chromium-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

firefox-image.json: image.json
firefox-image.json: load-image-json
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=node-${image_name} --build-arg=BROWSER=firefox -t firefox-${image_name} .
docker image inspect firefox-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
Expand Down
8 changes: 6 additions & 2 deletions transport-interop/impl/js/v2.x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ image_name := js-v2.x
# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in
all: image.json chromium-image.json firefox-image.json update-lock-file

# Necessary because multistage builds require a docker image name rather than a digest to be used
load-image-json: image.json
docker image tag $$(jq -r .imageID image.json) ${image_name}

image.json:
docker builder prune -af
docker build -t node-${image_name} -f ./Dockerfile .
docker image inspect node-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

chromium-image.json: image.json
chromium-image.json: load-image-json
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=node-${image_name} --build-arg=BROWSER=chromium -t chromium-${image_name} .
docker image inspect chromium-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

firefox-image.json: image.json
firefox-image.json: load-image-json
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=node-${image_name} --build-arg=BROWSER=firefox -t firefox-${image_name} .
docker image inspect firefox-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
Expand Down

0 comments on commit 6130748

Please sign in to comment.