# Docker-compose vs docker compose

**URL:** <https://forums.docker.com/t/docker-compose-vs-docker-compose/137884>\
**Category:** General\
**Created:** [September 28, 2023, 7:33pm UTC](https://forums.docker.com/t/docker-compose-vs-docker-compose/137884 "2023-09-28T19:33:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [September 28, 2023, 7:46pm UTC](https://forums.docker.com/t/docker-compose-vs-docker-compose/137884/2 "2023-09-28T19:46:54Z")

</div>

It seems you misinterpreted the documentation. The only requuirement of Docker Compose is docker since docker compose is another client for Docker which let’s you define everything in a yaml file. Compose v1 was originally written in Python, so you could install it in a Python virtual environment. Compose v2 was written in Go but for the same purpose.

I guess you found different examples for v1 and v2 but both versions can help you build a Docker image which requires a Dockerfile usually. v2 also supports the `dockerfile_inline` option so you can write the content of the Dockerfile there. It is not a requirement of any compose. It is used by Docker to build an image and you can define that too in the compose file. Compose v2 also ignores the version keyword in the compose file.

Regarding the filename, since Compose v2 is a plugin for Docker, you can use it as `docker compose`, but you could easily add an alias to that command as `docker-compose` which was how the command of Compose v1 was named.

Usually you can follow a tutorial written for compose v1 and use `docker compose` instead of `docker-compose`.

I have a tutorial too in which I write about compose as well: [Welcome to Learn Docker’s documentation! — Learn Docker documentation](https://learn-docker.it-sziget.hu/en/latest/index.html)  
I wrote it for compose v1. When I rewrote it for v2 I basically just replaced all `docker-compose` commands with `docker compose` and removed the version keyword from the compose files.

There are some features though that compose v2 doesn’t support. I wrote about one here: [Docker Compose volumes, volume-only projects and init containers - DEV Community](https://dev.to/rimelek/docker-compose-volumes-volume-only-projects-and-init-containers-5468)

You can read about other differences in the documentation:

> **[Migrate to Compose V2](https://docs.docker.com/compose/migrate/)**
>
> How to migrate from Compose V1 to V2

---

_[View the full topic](https://forums.docker.com/t/docker-compose-vs-docker-compose/137884)._
