Skip to content

Enable usage of --ansi never argument to be support docker-compose based CLI syntax #1077

Open
@nilsjha

Description

@nilsjha

Libraries like Spring Boot have implementations for docker-compose CLI, which breaks when using podman-compose as a direct drop-in replacement. By drop-in, I've symlinked docker-compose to podman-compose . The library here (Spring) references the --ansi argument, which is present in docker-compose, but not in podman-compose.

See https://github.com/spring-projects/spring-boot/blob/74d69d0eb150d5f17e3715f225eb4f5809df9202/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerCli.java#L100

If having the support to specify --ansi never as an alternative to --no-ansi, the utilities will be more cross-compatible.

2024-11-27T20:27:15.988+01:00 ERROR 73685 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.boot.docker.compose.core.ProcessExitException: 'docker compose --file /home/<project-dir>/compose.yaml --ansi never config --format=json' failed with exit code 2.

Stdout:
Stderr:
>>>> Executing external compose provider "/usr/local/bin/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

usage: docker-compose [-h] [-v] [--in-pod in_pod] [--pod-args pod_args]
                      [--env-file env_file] [-f file] [--profile profile]
                      [-p PROJECT_NAME] [--podman-path PODMAN_PATH]
                      [--podman-args args] [--podman-pull-args args]
                      [--podman-push-args args] [--podman-build-args args]
                      [--podman-inspect-args args] [--podman-run-args args]
                      [--podman-start-args args] [--podman-stop-args args]
                      [--podman-rm-args args] [--podman-volume-args args]
                      [--no-ansi] [--no-cleanup] [--dry-run]
                      [--parallel PARALLEL] [--verbose]
                      {help,version,wait,systemd,pull,push,build,up,down,ps,run,exec,start,stop,restart,logs,config,port,pause,unpause,kill,stats,images}
                      ...
docker-compose: error: argument command: invalid choice: 'never' (choose from help, version, wait, systemd, pull, push, build, up, down, ps, run, exec, start, stop, restart, logs, config, port, pause, unpause, kill, stats, images)
Error: executing /usr/local/bin/docker-compose --file /home/<project-dir>/compose.yaml --ansi never config --format=json: exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions