I'm trying to stop or rm services by passing a profile, but this stops all services instead of just the one with this profile.
The up command seems to work fine
This is my docker-compose.yaml
version: '3.9'
services:
registry:
container_name: registry
image: registry:latest
pull_policy: missing
profiles:
- registry_service_profile
...
portainer:
container_name: portainer
image: localhost:5000/my-portainer
pull_policy: missing
profiles:
- other_services_profile
...
pihole:
container_name: pihole
image: localhost:5000/my-pihole
pull_policy: missing
profiles:
- other_services_profile
...
bitwarden:
container_name: bitwarden
image: localhost:5000/my-bitwarden
profiles:
- other_services_profile
pull_policy: missing
...
homeassistant:
container_name: homeassistant
image: localhost:5000/my-homeassistant
pull_policy: missing
profiles:
- other_services_profile
...
duplicati:
container_name: duplicati
image: localhost:5000/my-duplicati
pull_policy: missing
profiles:
- other_services_profile
...
Running the stop command with both profiles stops all services, not just the ones with the provided profile
user@pc:/opt/docker$ sudo docker compose --profile registry_service_profile stop
[+] Running 6/6
⠿ Container pihole Stopped 4.6s
⠿ Container portainer Stopped 0.7s
⠿ Container registry Stopped 0.4s
⠿ Container homeassistant Stopped 5.0s
⠿ Container bitwarden Stopped 0.5s
⠿ Container duplicati Stopped 4.5s
user@pc:/opt/docker$ sudo docker compose --profile registry_service_profile up --detach
[+] Running 1/1
⠿ Container registry Started 0.4s
user@pc:/opt/docker$ sudo docker compose --profile other_services_profile up --detach
[+] Running 5/5
⠿ Container portainer Started 0.7s
⠿ Container homeassistant Started 0.2s
⠿ Container bitwarden Started 0.6s
⠿ Container pihole Started 0.9s
⠿ Container duplicati Started 0.9s
user@pc:/opt/docker$ sudo docker compose --profile other_services_profile stop
[+] Running 6/6
⠿ Container portainer Stopped 0.4s
⠿ Container pihole Stopped 4.5s
⠿ Container registry Stopped 0.6s
⠿ Container duplicati Stopped 4.4s
⠿ Container homeassistant Stopped 5.0s
⠿ Container bitwarden Stopped 0.5s
user@pc:/opt/docker$ docker --version
Docker version 20.10.17, build 100c701
Am I doing something wrong?
Or I should just run docker compose up command and this should update the services to the latest pulled version?