Mapping
| docker run | compose.yaml |
|---|---|
-p 8080:80 | ports: ["8080:80"] |
-v data:/var/lib | volumes: + top-level named volume |
-e KEY=value | environment: |
--restart unless-stopped | restart: unless-stopped |
--network mynet | networks: (external) |
Options without a direct equivalent are listed as warnings.
Frequently asked questions
Is the file called docker-compose.yml or compose.yaml?
Both work; compose.yaml is the current recommended name.
Do I need the version: key?
No, it is obsolete in Docker Compose v2.
Is anything sent to a server?
No, conversion runs in your browser.

