Closed
Description
Since docker compose v 2.3.0 when ever I run docker compose with command start
, stop
, restart
, and up
all container for service with profile in docker-compose.yml will be always included even the profile is not enabled.
example command
# will create container for service without profile but will start all container
# even the container is for service with profile
docker compose up -d
# will start/stop/restart all container even the container is for service with profile
docker compose start
docker compose stop
docker compose restart
example docker-compose.yml
version: "3.9"
services:
serviceA:
...
serviceB:
...
profiles: ["debug"]
step by step
# will create and start container for service A
docker compose up -d
# will start/stop/restart container for service A
docker compose start
docker compose stop
docker compose restart
# will stop and remove container for service A
docker compose down
# will create and start container for service B
docker compose up -d serviceB
# will stop container for service B
docker compose stop serviceB
# will create and start container for service A
# also start serviceB <-- why? profile 'debug' is not enabled
docker compose up -d
# will start/stop/restart container for service A
# also start/stop/restart serviceB <-- why? profile 'debug' is not enabled
docker compose start
docker compose stop
docker compose restart
Metadata
Metadata
Assignees
Labels
No labels