Skip to content

Commit

Permalink
build: use ephemereal ports
Browse files Browse the repository at this point in the history
Previously, docker-compose used fixed port mappings (host and container
ports matched, e.g: 4420:4420). However, that doesn't allow to deploy
multiple instances of the same container (--scale nvmeof=N).

Instead, ephemeral ports (randomly assigned by docker-compose) need to
be used. Fortunately, docker-compose provides with the 'port' command,
which maps container to host ports.

Signed-off-by: Ernesto Puerta <[email protected]>
  • Loading branch information
epuertat committed Jul 14, 2023
1 parent 9f5d4e4 commit 6c176fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
timeout-minutes: 1
run: |
. .env
until nc -z localhost $NVMEOF_GW_PORT; do
HOST_PORT=$(make -s port OPTS="--index=1" CMD="nvmeof $NVMEOF_GW_PORT" | tr ":" " ")
until nc -z $HOST_PORT; do
echo -n .
sleep 1
done
Expand Down

0 comments on commit 6c176fd

Please sign in to comment.