containers / containers/podman-compose
podman-compose stops deploying the other containers when using "command:" in yml-file
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
Hello everyone, in the following I noticed that an identical yml-file, which works with docker-compose and needs the "command:" parameter in yaml, gets stuck with podman-compose when executing the "command".
I have been searching for a long time for a solution and the error in connection with podman-compose and my yaml-file but found nothing. in the appendix i first attach the console output and then the yaml-file itself.
**console output:**
```
[root@ciborack letsencrypt]# /usr/local/bin/podman-compose -f /opt/podman-rocketchat/podman_compose.yml up -d
[root@ciborack letsencrypt]# podman pod ls
POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID
c701b557dc9a podman-rocketchat Running 3 minutes ago 3 ddca67c20474
[root@ciborack letsencrypt]# podman pod top podman-rocketchat
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
0 1 0 0.000 2m21.362544271s ? 0s /pause
mongodb 1 0 0.000 2m21.370493234s ? 0s mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 --bind_ip_all
[root@ciborack letsencrypt]# /usr/local/bin/podman-compose -f /opt/podman-rocketchat/podman_compose.yml down
```
**yml-file:**
```
version: "3.2"
services:
# ----------------------------------------------------------------------------
mongo:
image: mongo:4.0
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
volumes:
- /opt/podman-rocketchat/data/db:/data/db
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
# ----------------------------------------------------------------------------
# this container's job is just run the command to initialize the replica set.
# it will run the command and remove himself (it will not stay running)
mongo-init-replica:
image: mongo:4.0
command: 'bash -c "for i in `seq 1 30`; do mongo mongo/rocketchat --eval \"rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})\" && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 secs...\"; sleep 5; done; (exit $$s)"'
depends_on:
- mongo
# ----------------------------------------------------------------------------
rocketchat:
image: rocketchat/rocket.chat:latest
command: bash -c 'for i in `seq 1 30`; do node main.js && s=$$? && break || s=$$?; echo "Tried $$i times. Waiting 5 secs..."; sleep 5; done; (exit $$s)'
container_name: "rocketchat-main"
volumes:
- /opt/podman-rocketchat/uploads:/app/uploads
- /etc/localtime:/etc/localtime:ro
environment:
- PORT=3000
- ROOT_URL=https://chat.cibolini.ch
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
- MAIL_URL=smtp://smtp.email
depends_on:
- mongo
ports:
- 3000:3000
restart: unless-stopped
```
Best regards deepwather
Contributor guide
Research direction
Reproduce the report with /opt/podman-rocketchat/podman_compose.yml by running /usr/local/bin/podman-compose up -d, then inspect how the command entries for mongo, mongo-init-replica, and rocketchat are handled. Done means the compose file deploys the other containers instead of stopping after the command-bearing service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, python, yaml
- Domain
- cli, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100