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

option "--no-deps" is ignored for "podman-compose up" #398

Open
bam80 opened this issue Jan 3, 2022 · 7 comments
Open

option "--no-deps" is ignored for "podman-compose up" #398

bam80 opened this issue Jan 3, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@bam80
Copy link

bam80 commented Jan 3, 2022

The option has no effect:

$ podman-compose up --help
...
  --no-deps             Don't start linked services.
@muayyad-alsadi
Copy link
Collaborator

to be fair, --no-deps only makes sense with run not with up.

but I'll look into it.

@diodakus
Copy link

diodakus commented Mar 29, 2022

To Reproduce
Steps to reproduce the behavior:

  1. create docker-compose.yml file according below content:
version: '3.5'
services:
  sh:
    command: [/bin/sh]
    image: busybox
    volumes:
      - /tmp/service_sh:/tmp/service_sh:rw

  ci-dev-sh:
    extends:
      service: sh
    volumes:
      - /tmp/service_ci-dev-sh:/tmp/service_ci-dev-sh:rw

  ci-dev-sh2:
    extends:
      service: ci-dev-sh
    volumes:
      - /tmp/service_ci-dev-sh2:/tmp/service_ci-dev-sh2:rw

  other-sh:
    extends:
      service: sh
    volumes:
      - /tmp/service_other-sh:/tmp/service_other-sh:rw
  1. Run command: podman-compose run sh sh

Expected behavior

podman-compose version: 1.0.4
['podman', '--version', '']
using podman version: 3.4.2
podman pod create --name=pod_slawek --infra=false --share=
618099eb399286e615a6736e17c0b6b147e1067d6f7e32586249f609ab298aa0
exit code: 0
['podman', 'network', 'exists', 'slawek_default']
podman run --name=slawek_sh_tmp56944 --rm -i --pod=pod_slawek --label io.podman.compose.config-hash=8046c9387919915040c14f6ec8fba1058b3ba36d6880deafbb67234245f55384 --label io.podman.compose.project=slawek --label io.podman.compose.version=1.0.4 --label com.docker.compose.project=slawek --label com.docker.compose.project.working_dir=/home/slawek --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=sh -v /tmp/service_sh:/tmp/service_sh:rw --net slawek_default --network-alias sh --tty busybox sh
/ #

Actual behavior
Podman-compose starts all docker-compose services what found in docker-compose.yml file (without depends_on tag). Docker-compose in that case for run starts only provided service from command line - it means "sh".

podman-compose version: 1.0.4
['podman', '--version', '']
using podman version: 3.4.2
podman pod create --name=pod_slawek --infra=false --share=
d6260f0e99393b74def9e69d37c13bf274034519e7bc14a2338db2cb665e3bdb
exit code: 0
** excluding:  set()
['podman', 'ps', '--filter', 'label=io.podman.compose.project=slawek', '-a', '--format', '{{ index .Labels "io.podman.compose.config-hash"}}']
podman pod create --name=pod_slawek --infra=false --share=
Error: error adding pod to state: name "pod_slawek" is in use: pod already exists
exit code: 125
['podman', 'network', 'exists', 'slawek_default']
podman run --name=slawek_sh_1 -d --pod=pod_slawek --label io.podman.compose.config-hash=8046c9387919915040c14f6ec8fba1058b3ba36d6880deafbb67234245f55384 --label io.podman.compose.project=slawek --label io.podman.compose.version=1.0.4 --label com.docker.compose.project=slawek --label com.docker.compose.project.working_dir=/home/slawek --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=sh -v /tmp/service_sh:/tmp/service_sh:rw --net slawek_default --network-alias sh busybox /bin/sh
85ab4cbb1521595cde34d79fc566751f8699493b85b760ad09757fae0646bf3d
exit code: 0
['podman', 'network', 'exists', 'slawek_default']
podman run --name=slawek_ci-dev-sh_1 -d --pod=pod_slawek --label io.podman.compose.config-hash=8046c9387919915040c14f6ec8fba1058b3ba36d6880deafbb67234245f55384 --label io.podman.compose.project=slawek --label io.podman.compose.version=1.0.4 --label com.docker.compose.project=slawek --label com.docker.compose.project.working_dir=/home/slawek --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=ci-dev-sh -v /tmp/service_sh:/tmp/service_sh:rw -v /tmp/service_ci-dev-sh:/tmp/service_ci-dev-sh:rw --net slawek_default --network-alias ci-dev-sh busybox /bin/sh
b41fdb3fea79437bac3d2c3bc0608445a5c9eb42bdbb16de37993152b53f586a
exit code: 0
['podman', 'network', 'exists', 'slawek_default']
podman run --name=slawek_ci-dev-sh2_1 -d --pod=pod_slawek --label io.podman.compose.config-hash=8046c9387919915040c14f6ec8fba1058b3ba36d6880deafbb67234245f55384 --label io.podman.compose.project=slawek --label io.podman.compose.version=1.0.4 --label com.docker.compose.project=slawek --label com.docker.compose.project.working_dir=/home/slawek --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=ci-dev-sh2 -v /tmp/service_sh:/tmp/service_sh:rw -v /tmp/service_ci-dev-sh:/tmp/service_ci-dev-sh:rw -v /tmp/service_ci-dev-sh2:/tmp/service_ci-dev-sh2:rw --net slawek_default --network-alias ci-dev-sh2 busybox /bin/sh
e2f3e68a1660f30284be655f206deab9fe5ce6b5e0659300135e1064e310ee62
exit code: 0
['podman', 'network', 'exists', 'slawek_default']
podman run --name=slawek_other-sh_1 -d --pod=pod_slawek --label io.podman.compose.config-hash=8046c9387919915040c14f6ec8fba1058b3ba36d6880deafbb67234245f55384 --label io.podman.compose.project=slawek --label io.podman.compose.version=1.0.4 --label com.docker.compose.project=slawek --label com.docker.compose.project.working_dir=/home/slawek --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=other-sh -v /tmp/service_sh:/tmp/service_sh:rw -v /tmp/service_other-sh:/tmp/service_other-sh:rw --net slawek_default --network-alias other-sh busybox /bin/sh
db5ba8227e5f5d00d1aba0610e7235c62e4797d261f016e96889cd83035ac259
exit code: 0
['podman', 'network', 'exists', 'slawek_default']
podman run --name=slawek_sh_tmp55976 --rm -i --pod=pod_slawek --label io.podman.compose.config-hash=8046c9387919915040c14f6ec8fba1058b3ba36d6880deafbb67234245f55384 --label io.podman.compose.project=slawek --label io.podman.compose.version=1.0.4 --label com.docker.compose.project=slawek --label com.docker.compose.project.working_dir=/home/slawek --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=sh -v /tmp/service_sh:/tmp/service_sh:rw --net slawek_default --network-alias sh --tty busybox sh
/ # 

@muayyad-alsadi
Copy link
Collaborator

I've noticed that, I believe run with no dependency was understood as up with no argument which mean all.
I'll fix that.

@muayyad-alsadi
Copy link
Collaborator

@diodakus I've fixed your issue please test.

@diodakus
Copy link

@muayyad-alsadi I confirm that issue were solved.

@Steiniche
Copy link

@muayyad-alsadi I believe this issue can be closed as resolved.

@s1saurabh
Copy link

I am still facing issue in below version, podman-compose unnecessary tends to recreate all dependencies when it already exists and --no-deps is given

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants