Skip to content

Commit

Permalink
Force compose to use conventional ports
Browse files Browse the repository at this point in the history
I only noticed b/c `podman-compose down` followed by `podman-compose up`
broke my dev setup.

So, the difference between `5432` and `5432:5432`:

 - `5432` instructs podman to pick an arbitrary port to map to a
   container's port `5432`
 - `5432:5432` instructs podman to map the host's port `5432` to a
   container's port `5432`

podman v2.2.0+ ensures that the arbitrary port is random.

See containers/podman#7947
  • Loading branch information
kahowell committed Jan 13, 2021
1 parent fcfdc1d commit e594962
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions container-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ services:
volumes:
- ./init_dbs.sh:/docker-entrypoint-initdb.d/init_dbs.sh:z
ports:
- "5432"
- "5432:5432"
zookeeper:
image: docker.io/confluentinc/cp-zookeeper
ports:
- "32181"
- "32181:32181"
environment:
- ZOOKEEPER_CLIENT_PORT=32181
- ZOOKEEPER_SERVER_ID=1
Expand Down

0 comments on commit e594962

Please sign in to comment.