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

[BUG] Weird behavior between orphaned containers and --remove-orphans flag #12015

Open
MatTheCat opened this issue Jul 24, 2024 · 2 comments
Open

Comments

@MatTheCat
Copy link

MatTheCat commented Jul 24, 2024

Description

After using run on an updated Compose, I’ve been greeted by a

WARN[0000] Found orphan containers […] for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

The thing is, I didn’t remove or rename the corresponding service, so I don’t know how to reproduce.

Adding the --remove-orphans flag on run didn’t change anything, but it did work with up.

Steps To Reproduce

No response

Compose Version

$ docker compose version
Docker Compose version v2.29.0

Docker Environment

$ docker info
docker info
Client: Docker Engine - Community
 Version:    27.1.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 11
  Running: 4
  Paused: 0
  Stopped: 7
 Images: 30
 Server Version: 27.1.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 6.5.0-44-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 30.74GiB
 Name: P-ASN-TINY
 ID: 35d93767-e18b-4cc4-8eeb-d7fd382366f2
 Docker Root Dir: /home/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@richardnpaul
Copy link

I came across this myself just in the last week or so. I have seen quite a few docker and compose updates coming out over the last week or two so I wonder if this is a config issue which has always existed but not surfaced or if it's an errant error that has been introduced.

@richardnpaul
Copy link

Just an update on this. --remove-orphans doesn't do anything when used with the run command as @MatTheCat says, however, if you add the --rm flag to the run command instead this does prevent the issue of the build-up of orphaned containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants