Skip to content

Commit

Permalink
Adjusted Makefile to operate with nix
Browse files Browse the repository at this point in the history
Also, loading + extracting image ID in one line.

Ref: docker/cli#2212 (comment)
  • Loading branch information
Ocramius committed Sep 4, 2023
1 parent ad9294e commit 6d0066a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Push docker image to ghcr.io
run: |
IMG_ID=$( docker images --filter "reference=oci-srm-server-mock-rust" --format "{{.ID}}" )
IMG_ID=$$(docker load -i result | sed -nr 's/^Loaded image: (.*)$/\1/p' | xargs -I{} docker image ls "{}" --format="{{.ID}}")
echo "Tagging $IMG_ID"
docker tag $IMG_ID ghcr.io/ocramius/oci-srm-server-mock-rust:${{ github.event.release.tag_name }}
docker push ghcr.io/ocramius/oci-srm-server-mock-rust:${{ github.event.release.tag_name }}
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ run:
PUNCHOUT_SERVER_CONFIRMATION_URI=http://localhost:1111/ \
OCI_SRM_SERVER_MOCK_BASE_URL=http://localhost:8089/ \
OCI_SRM_SERVER_MOCK_PORT=8089 \
cargo run
nix run

buildx:
docker buildx build -t oci-srm-server-mock:latest --load .
build:
nix build .\#docker-image
IMG_ID=$$(docker load -i result | sed -nr 's/^Loaded image: (.*)$/\1/p' | xargs -I{} docker image ls "{}" --format="{{.ID}}")
docker tag $$IMG_ID ci-srm-server-mock:latest

docker:
docker run \
Expand Down

0 comments on commit 6d0066a

Please sign in to comment.