# docker compose helper scripts [![pknw1logo-white.png](https://bookstack.pknw1.co.uk/uploads/images/gallery/2025-01/scaled-1680-/HLPpknw1logo-white-png.png)](https://bookstack.pknw1.co.uk/uploads/images/gallery/2025-01/scaled-1680-/HLPpknw1logo-white-png.png) ##### `/usr/local/bin/uplog` ****Helper Scripts**** The docker helper scripts are to allow more rapid access to frequent requests - [ ] create `/usr/local/bin/uplog` - [ ] chmod +x `/usr/local/bin/uplog` ``` #!/bin/bash # /usr/local/bin/uplog if [[ $# -eq 0 ]] then docker compose up -d && docker compose logs -f else docker compose -f $1.yml up -d && docker compose -f $1.yml logs -f fi ``` - [ ] update profile aliases - [ ] vi `~/.bash_aliases` - [ ] logout and back in ``` # additional bash_alias entries for docker management alias down='docker compose down' alias up='docker compose up -d' alias logs='docker compose logs -f' ``` ``` ```
no additional details
****docker-image-prune-3months**** a script to remove all un-used docker images over 3 months old ``` #!/bin/bash # docker-image-prune-3months.sh echo "BEFORE $(docker image ls |wc -l)" time docker image prune --all --filter "until=2160h" echo "AFTER $(docker image ls |wc -l)" ``` ****docker-latest-images**** pulls the latest docker images and restarts affected containers ``` #!/bin/bash # docker-latest-images.sh find /home/docker/services -iname docker-compose.yml -exec docker compose -f "{}" pull \; find /home/docker/services -mindepth 1 -maxdepth 1 -type d | while read -r DIR do cd "${DIR}" TEST=$(docker compose ps -q) [ -z $TEST ] && cd "${DIR}" && docker compose up [ -z $TEST ] || echo "${DIR} not running" done ``` ****further info****
****Product Home**** n/a
****Documentation**** n/a
****Github**** n/a
****DockerHub**** n/a
****Misc**** n/a