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

Document migration instructions for users that use -t option flag. #420

Closed
whitingjr opened this issue Feb 7, 2022 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@whitingjr
Copy link

Is your feature request related to a problem? Please describe.
A problem.
A project I am working on provides instructions that use podman-compose. The major release version 1.x breaks the instructions.
See issue

Describe the solution you'd like
Users migrating from v 0.x to 1.x will see breaking changes. Some documentation to set out migration steps will be exceptionally useful in the Wiki or a Blog post.

an example of a command that used to work

$ podman-compose -f podman-compose.yml -t hostnet up -d

after upgrading this error is reported

podman-compose: error: argument command: invalid choice: 'hostnet' (choose from 'help', 'version', 'pull', 'push', 'build', 'up', 'down', 'ps', 'run', 'exec', 'start', 'stop', 'restart', 'logs')

Describe alternatives you've considered
Downgrading podman-compose to 0.x

Additional context

 podman-compose version
['podman', '--version', '']
using podman version: 3.4.2
podman-composer version  1.0.3
podman --version 
podman version 3.4.2
exit code: 0

@whitingjr whitingjr added the enhancement New feature or request label Feb 7, 2022
@muayyad-alsadi
Copy link
Collaborator

I'll update the readme

The option flag -t has changed purpose.

no, -t for timeout was already there in 0.1.x

[email protected]]$ ./podman_compose.py up --help
usage: podman_compose.py up [-h] [-d] [--no-color] [--quiet-pull] [--no-deps] [--force-recreate] [--always-recreate-deps] [--no-recreate] [--no-build] [--no-start] [--build] [--abort-on-container-exit] [-t TIMEOUT] [-V]
                            [--remove-orphans] [--scale SERVICE=NUM] [--exit-code-from SERVICE] [--pull] [--pull-always] [--build-arg key=val] [--no-cache]
                            [services ...]

positional arguments:
  services              affected services

optional arguments:
  -h, --help            show this help message and exit
  -d, --detach          Detached mode: Run container in the background, print new container name. Incompatible with --abort-on-container-exit.
  --no-color            Produce monochrome output.
  --quiet-pull          Pull without printing progress information.
  --no-deps             Don't start linked services.
  --force-recreate      Recreate containers even if their configuration and image haven't changed.
  --always-recreate-deps
                        Recreate dependent containers. Incompatible with --no-recreate.
  --no-recreate         If containers already exist, don't recreate them. Incompatible with --force-recreate and -V.
  --no-build            Don't build an image, even if it's missing.
  --no-start            Don't start the services after creating them.
  --build               Build images before starting containers.
  --abort-on-container-exit
                        Stops all containers if any container was stopped. Incompatible with -d.
  -t TIMEOUT, --timeout TIMEOUT
                        Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)
  -V, --renew-anon-volumes
                        Recreate anonymous volumes instead of retrieving data from the previous containers.
  --remove-orphans      Remove containers for services not defined in the Compose file.
  --scale SERVICE=NUM   Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.
  --exit-code-from SERVICE
                        Return the exit code of the selected service container. Implies --abort-on-container-exit.
  --pull                attempt to pull a newer version of the image
  --pull-always         attempt to pull a newer version of the image, Raise an error even if the image is present locally.
  --build-arg key=val   Set build-time variables for services.
  --no-cache            Do not use cache when building the image.

basically there are two -t the global one and the command-specific one
we removed the global one.

regarding your specific case, you can use their docker-compose without any change.
or if you want host network behavior you can pass network_mode: host on each service
like this

version: '3'
services:
  web:
    image: busybox
    command: httpd -f -p 8123 -h /mnt/
    network_mode: host
    volumes:
    -.:/mnt

@whitingjr
Copy link
Author

@muayyad-alsadi Thank you for the suggestions and background. I am happy to close this issue if you think appropriate. Or keep it open as a reminder to update README.md if you need.

@whitingjr
Copy link
Author

whitingjr commented Feb 9, 2022

I have added configuration as suggested. I am finding containers are not visible to each other. For reference here is my podman-compose.yaml file. Testing the command like this

podman-compose -f podman-compose.yml up -d

The error I am concerned with are the logs for a service called keycloak.

podman logs --tail=400 horreum_grafana_1

I am seeing this tell tail error message
PSQLException: Connection to postgres:5432 refused

Something isn't working as it did beforehand. Any suggestions ?

@muayyad-alsadi
Copy link
Collaborator

you need to adjust the environment to replace hostnames named after service names into localhost

for example

  db-init:
    environment:
    - PGHOST=localhost

  keycloak:
    environment:
    - DB_ADDR=localhost

@muayyad-alsadi
Copy link
Collaborator

when using network_mode=host, you need to use localhost to communicate neither podman-compose nor docker-compose set host aliases for services

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

2 participants