docker composeas a go based plugin for docker (rather than a python based standalone binary). And they also publish this plugin for various arches, including x86_64, armhf and aarch64 (as opposed to the x86_64 only binaries for v1.X). Therefore we updated our recommended install option to utilize the plugin.
docker composevia the following commands:
docker compose versionshould display the compose version.
docker compose argsinstead of
docker-compose args. There are also some slight differences in how the yaml is operated as well. To make migration easier, Docker released a replacement binary for
docker-composeon x86_64 and aarch64 platforms. More info on that can be found at the upstream repo.
docker compose). If you'd like to use v1 images, you can set an env var
DOCKER_COMPOSE_IMAGE_TAG=ubuntuin your respective
.profile. Alternatively you can set that var to a versioned image tag like
version-alpine-1.27.4to pin it to a specific docker-compose version.
docker-compose.yml, you can simply run
docker compose up -dfrom within the same folder and the heimdall image will be automatically pulled, and a container will be created and started.
upmeans bring the services up, and
-dmeans do it in the background.
heimdall.yml, then you can define it in the command with
docker compose -f /path/to/heimdall.yml up -d
docker compose downor
docker compose -f /path/to/heimdall.yml downand all containers defined by the yml will be stopped and destroyed.
services:line in any of our readme yaml samples into the same yaml file and the
docker compose up/downcommands will apply to all services at once.
mariadb. When you do a
docker compose up -d, it will first download the images for all three if they don't exist (if they exist, they are not updated) and it will create all three containers and start them.
docker compose downwill bring all three services down and destroy the containers (persistent data will remain).
docker compose pull. Then we issue
docker compose up -dand it will automatically recreate the containers (as necessary) based on the updated images. If a container's image is already the latest and there was no update, it remains untouched.
docker compose up -d, only the containers affected by the changes to the yaml file will be recreated, others will be untouched.
docker runcommands and then forgetting which variables you passed is a thing of the past when using
.env, please post an output of
docker compose convertor
docker compose convert -f /path/to/compose.ymlfor the entire yaml, or
docker compose convert <service name>for a single service, as it will automatically replace the environment variables with their actual values.
docker composeexpects a
docker-compose.ymlfile in the current directory and if one isn't present it will complain. In order to improve your quality of life we suggest the use of bash aliases. The file path for the aliases below assumes that the
docker-compose.ymlfile is being kept in the folder
/opt. If your compose file is kept somewhere else, like in a home directory, then the path will need to be changed.
~/.bash_aliasesand populate with the following content:
docker-compose.ymlfile is in a home directory, the following can be put in the
docker logsis preferable to
docker compose logs. By default
docker logswill not run unless you define which service the logs are coming from. The
docker compose logswill pull all of the logs for the services defined in the
docker-compose.ymlfile, it is not helpful to submit all of the logs. If you are experiencing issues with a single service, say Heimdall, then you would want to get your logs using
docker logs heimdallor
docker compose logs heimdall. The bash_alias for
dclogscan be used if you define your service after you've typed the alias. Likewise, the bash_alias
detailwill not run without defining the service after it.
~/.bashrcfile. If it is not included, you'll need to add the following to your
~/.bashrcfile in order for the aliases file to be picked up:
source ~/.bashrcor log out and the log in again. Now you can type
dcupto manage your entire fleet of containers at once. It's like magic.