Skip to content

/changelogs/docker-compose/compose-v1-to-v2

docker-compose v1 to docker compose v2: what changed

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · Docker Compose version v5.6.0updated 2026-10-20
tool
Docker Compose
versions
1.29 → 2.x and later

Compose v1 was the Python docker-compose tool. Compose v2 is a rewrite in Go that ships as the docker compose plugin of the Docker CLI (Docker Desktop and the docker-compose-plugin package include it); later major versions continue the same line. Most files work unchanged, but a few behaviours differ.

The version key is obsolete

bash
cat > docker-compose.yml <<'EOF'
version: "3.8"
name: demo
services:
  web:
    image: nginx:1.29
EOF
docker-compose config 2>&1 | sed 's/^time="[^"]*" //'

Output

level=warning msg="/tmp/work/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
name: demo
services:
  web:
    image: nginx:1.29
    networks:
      default: null
networks:
  default:
    name: demo_default

Remove the line: Compose always uses the latest Compose Specification and no longer reads the version number.

Changes that affect scripts

Areav1v2+
Commanddocker-compose updocker compose up (docker-compose may exist as an alias)
Container namedemo_web_1demo-web-1
File versionversion: "3.8" required for v3 featuresignored, warning printed
Default filedocker-compose.ymlcompose.yaml (old names still found)
Builddocker-py builderBuildKit / buildx by default
Profiles, depends_on conditionspartial (file-format dependent)full Compose Specification

Migration checklist

  1. Replace docker-compose with docker compose in scripts and CI.
  2. Delete the version: line.
  3. Search for container names with underscores (_1) and switch to hyphens, or set container_name explicitly.
  4. Optionally rename docker-compose.yml to compose.yaml.

Sources