Skip to content

[BUG] COMPOSE_COMPATIBILITY=true ENV not respected anymore (--compatibility is) #13422

@systemofapwne

Description

@systemofapwne

Description

I rely on certain scripts like below, that use COMPOSE_COMPATIBILITY ENV to fallback to v1 container naming schemes. The scripts may looked likt this

#!/bin/bash

# Container names as folder_service_instance instead of folder-service-instance
export COMPOSE_COMPATIBILITY=true

#Pull latest images as described in compose.yml
docker compose pull

#Rebuild everything
docker compose up --build -d

This used to work like 2 days ago but now seems to be broken with compose v5.

Using docker compose --compatibility up --build -d however still produces the v1 names, that I rely on.

Steps To Reproduce

  1. Set ENV: export COMPOSE_COMPATIBILITY=true
  2. Run docker compose up --build -d
  3. The container will now be named according to v2 naming scheme (folder-container-1) instead of (folder_container_1)

Compose Version

Docker Compose version v5.0.0

Docker Environment

Client: Docker Engine - Community
 Version:    29.1.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.30.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.0.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 74
  Running: 74
  Paused: 0
  Stopped: 0
 Images: 90
 Server Version: 29.1.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: syslog
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1c4457e00facac03ce1d75f7b6777a7a851e5c41
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  userns
  cgroupns
  no-new-privileges
 Kernel Version: 6.1.0-37-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 14
 Total Memory: 110GiB
 Name: Debian
 ID: CSXF:6MEF:R4RI:IISC:V755:AI5N:MVZQ:UW7L:DSRC:VUT5:E3FF:PJ5U
 Docker Root Dir: /var/lib/docker/1001.1001
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: true
 Default Address Pools:
   Base: 172.31.0.0/16, Size: 24
 Firewall Backend: iptables

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions