Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for podman-compose up --wait option #710

Open
avisiedo opened this issue Jun 13, 2023 · 0 comments
Open

Add support for podman-compose up --wait option #710

avisiedo opened this issue Jun 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@avisiedo
Copy link

avisiedo commented Jun 13, 2023

Describe the solution you'd like
Add the --wait option for podman-compose up as indicated at: https://docs.docker.com/engine/reference/commandline/compose_up/#options so it get closer to docker-compose interface. This will make easier the synchronization when automating podman-compose commands.

Describe alternatives you've considered
The workaround I am using on scenarios where I need the container to be in healthy state is a loop kind of:

.PHONY: .compose-wait-db                                                           
.compose-wait-db:                                                                  
    @printf "Waiting database"; \                                                  
    while [ "$$( podman container inspect --format '{{.State.Health.Status}}' "$(DOCKER_COMPOSE_PROJECT)_database_1" )" != "healthy" ]; \  
    do sleep 1; printf "."; \                                                      
    done; \                                                                        
    printf "\n"  

The container indicated there has a health check section defined in the docker-compose.yaml file.

Additional context

Using podman-version 1.0.6:

$ podman-compose version
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.5.0
podman-compose version 1.0.6
podman --version 
podman version 4.5.0
exit code: 0

Below the part of the docker-compose.yaml definition that I am using:

# https://docs.docker.com/compose/compose-file/compose-file-v2/
# https://docs.docker.com/compose/compose-file/compose-file-v3/
---
version: "2.4"
services:
  database:
    image: docker.io/postgres:13
    environment:
      - POSTGRES_USER=${DATABASE_USER}
      - POSTGRES_PASSWORD=${DATABASE_PASSWORD}
      - POSTGRES_DB=${DATABASE_NAME}
    ports:
      - ${DATABASE_EXTERNAL_PORT}:5432/tcp
    volumes:
      - database:/var/lib/postgresql/data
    healthcheck:
      test: "pg_isready"
      interval: 5s
      timeout: 3s
      retries: 10
      start_period: 3s
volumes:
  database:
@avisiedo avisiedo added the enhancement New feature or request label Jun 13, 2023
JP-Ellis added a commit to pact-foundation/pact-python that referenced this issue Oct 7, 2024
This is incompatible with Podman

Ref: containers/podman-compose#710
Signed-off-by: JP-Ellis <[email protected]>
JP-Ellis added a commit to pact-foundation/pact-python that referenced this issue Oct 9, 2024
This is incompatible with Podman

Ref: containers/podman-compose#710
Signed-off-by: JP-Ellis <[email protected]>
JP-Ellis added a commit to pact-foundation/pact-python that referenced this issue Oct 9, 2024
This is incompatible with Podman

Ref: containers/podman-compose#710
Signed-off-by: JP-Ellis <[email protected]>
JP-Ellis added a commit to pact-foundation/pact-python that referenced this issue Oct 9, 2024
This is incompatible with Podman

Ref: containers/podman-compose#710
Signed-off-by: JP-Ellis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant