Blame

309b1a feagor 2026-01-30 12:12:14 1
docker compose expects a compose.yml file 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 compose.yml file 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.
2
3
Create or open the file ~/.bash_aliases and populate with the following content:
99a575 feagor 2026-01-30 12:14:11 4
```bash
309b1a feagor 2026-01-30 12:12:14 5
alias dcup='docker compose -f /opt/compose.yml up -d' #brings up all containers if one is not defined after dcup
6
alias dcdown='docker compose -f /opt/compose.yml stop' #brings down all containers if one is not defined after dcdown
7
alias dcpull='docker compose -f /opt/compose.yml pull' #pulls all new images is specified after dcpull
8
alias dclogs='docker compose -f /opt/compose.yml logs -tf --tail="50" '
9
alias dtail='docker logs -tf --tail="50" "$@"'
506ddd feagor 2026-01-30 12:13:58 10
```
309b1a feagor 2026-01-30 12:12:14 11
12
If the compose.yml file is in a home directory, the following can be put in the ~/.bash_aliases file.
99a575 feagor 2026-01-30 12:14:11 13
```bash
309b1a feagor 2026-01-30 12:12:14 14
alias dcup='docker compose -f ~/compose.yml up -d' #brings up all containers if one is not defined after dcup
15
alias dcdown='docker compose -f ~/compose.yml stop' #brings down all containers if one is not defined after dcdown
16
alias dcpull='docker compose -f ~/compose.yml pull' #pulls all new images unless one is specified
17
alias dclogs='docker compose -f ~/compose.yml logs -tf --tail="50" '
18
alias dtail='docker logs -tf --tail="50" "$@"'
506ddd feagor 2026-01-30 12:13:58 19
```
309b1a feagor 2026-01-30 12:12:14 20
21
Some distributions, like Ubuntu, already have the code snippet below in the ~/.bashrc file. If it is not included, you'll need to add the following to your ~/.bashrc file in order for the aliases file to be picked up:
22
506ddd feagor 2026-01-30 12:13:58 23
```bash
309b1a feagor 2026-01-30 12:12:14 24
if [ -f ~/.bash_aliases ]; then
25
. ~/.bash_aliases
26
fi
506ddd feagor 2026-01-30 12:13:58 27
```
309b1a feagor 2026-01-30 12:12:14 28
Once configured, you can run source ~/.bashrc or log out and the log in again. Now you can type dcpull or dcup to manage your entire fleet of containers at once. It's like magic.