Skip to content

Commit

Permalink
fix: determine the correct Docker socket from the context
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Dec 3, 2024
1 parent 9dc4bd5 commit b65e487
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/actions/build-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ runs:
env:
SOURCE_DATE_EPOCH: 0

- run: docker context ls
shell: bash

- name: Get image name
shell: bash
id: imagename
Expand Down Expand Up @@ -154,11 +151,16 @@ runs:
echo "hash=" >> "${GITHUB_OUTPUT}"
fi
- name: Get Docker socket
id: socket
run: echo docker_socket="$(docker context ls --format json | jq -r 'select(.Current == true) | .DockerEndpoint' | sed 's!^unix://!!')" >> "${GITHUB_OUTPUT}"
shell: bash

- name: Security Scan
shell: bash
run: |
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${{ steps.socket.outputs.docker_socket }}:/var/run/docker.sock \
-v $(pwd)/.cache:/root/.cache \
-v $(pwd):/workdir \
-w /workdir \
Expand Down

0 comments on commit b65e487

Please sign in to comment.