Skip to content

[BUG] Can't bring down a container due to a missing env file #13135

@tj-smith47

Description

@tj-smith47

Description

If a mounted env-file has been deleted, you cannot bring down the container. Perhaps this is intentional rather than a bug, but if so, I would like to understand the reason a file should be required to kill a container? Is it not reasonable to allow ignoring this issue with a -f/--force flag?

Steps To Reproduce

  1. Create a compose file with a container that has an env_file entry.
  2. Bring up container.
  3. Delete file.
  4. Attempt to bring down container.

Compose Version

2.39.1

Docker Environment

Client: Docker Engine - Community
 Version:    28.3.3
 Context:    colima
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.26.1
    Path:     /opt/homebrew/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.39.1
    Path:     /opt/homebrew/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 12
  Running: 11
  Paused: 0
  Stopped: 1
 Images: 15
 Server Version: 24.0.7
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc version: v1.1.10-0-g18a0cb0
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.0-44-generic
 Operating System: Ubuntu 23.10
 OSType: linux
 Architecture: aarch64
 CPUs: 8
 Total Memory: 15.59GiB
 Name: colima
 ID: 2e618af5-c44c-4f2c-ae6b-f52931ae0fd5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions