File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -67,14 +67,20 @@ jobs:
6767 set -euo pipefail
6868 cid=$(docker run -d -p 0:3000 "$IMAGE_UNDER_TEST")
6969 trap "docker rm -f $cid >/dev/null 2>&1" EXIT
70- port=$(docker port "$cid" 3000/tcp | sed -E 's/.*:([0-9]+)$/\1/')
70+ port=$(docker inspect -f '{{ (index (index .NetworkSettings.Ports "3000/tcp") 0).HostPort }}' "$cid")
71+ if [ -z "$port" ]; then
72+ echo "Failed to resolve mapped port for container $cid" >&2
73+ docker logs "$cid" || true
74+ exit 1
75+ fi
7176 for i in {1..20}; do
7277 if curl -fsS "http://127.0.0.1:${port}/" > /dev/null; then
7378 exit 0
7479 fi
7580 sleep 1
7681 done
7782 echo "Service did not respond on / after 20s" >&2
83+ docker logs "$cid" || true
7884 exit 1
7985
8086 - name : Log in to GHCR
You can’t perform that action at this time.
0 commit comments