The docker compose
command wrapper is a shortcut for the command docker compose
. On top of that it supports using different docker-compose.yml
files depending on the DCC_ENV
variable.
It will wrap the docker compose command like this:
docker compose -f docker-compose.yml -f docker-compose.${DCC_ENV}.yml $@
$@
: these are all additional parameters you provide the dcc
command. For example, assuming the DCC_ENV
variable is dev
, if you type
dcc up -d
the following command will be executed:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
You can use all docker compose
command line arguments documented in the official documentation, except the special commands described below.
It also reads the .env
file every time the command is run and, if you are working in a git repository, it sets some git
related environment variables such as
GIT_VERSION=$(git describe --always)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD
GIT_LASTCOMMITDATE=$(git log -1 --format=%cI)
GIT_COMMITHASH=$(git rev-parse HEAD)
To shorthand often used commands the following shorthands are available:
ls
: lists all containers on the system with their statusrm
: removes all containers on the systemlg
: follow log filespo
: lists the exposed ports of all running containersnet
: show the network infrastructurerp
: lists the restart policy of all containersmt
: show mountsvol
: show volumesvolbkp
: backup a docker volume totar.gz
sh
: opens an interactive shell (bash) at a certain containerclean
: cleans the docker environment--help
or any docker compose command: https://docs.docker.com/compose/reference/
curl -Ls https://raw.githubusercontent.com/ETH-NEXUS/dcc/main/setup.sh | bash
dcc
will be installed to~/.local/bin
. Make sure~/.local/bin
is in yourPATH
.
If you encounter the following error...
dcc: error while loading shared libraries: libz.so.1: failed to map segment from shared object
...you can solve it using...
sudo mount /tmp -o remount,exec