sh update_docker_images.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh update_docker_images.sh相关的知识,希望对你有一定的参考价值。

#!/bin/bash

# # Pull docker images
# images=( linuxserver/cardigann linuxserver/jackett linuxserver/sonarr linuxserver/radarr linuxserver/couchpotato linuxserver/syncthing diaoulael/subliminal wernight/duplicity )
# for image in ${images[@]}; do
#     docker pull $image
# done

# Build docker images
apps=( cardigann jackett sonarr radarr couchpotato syncthing subliminal duplicity )
for app in ${apps[@]}; do
    docker build --pull --no-cache --tag <YOURNAMEOFCHOICE>/$app https://github.com/hotio/docker-$app.git
done

# Stop containers
apps=( syncthing radarr sonarr jackett cardigann )
for app in ${apps[@]}; do
    systemctl stop docker-$app
    sleep 10
done

# Start containers
apps=( cardigann jackett sonarr radarr syncthing )
for app in ${apps[@]}; do
    systemctl start docker-$app
    sleep 10
done

# Remove leftover containers
docker ps -a -f status=exited -q | xargs -r docker rm

# Remove leftover images
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi

# Remove dangling volumes
docker volume ls -qf dangling=true | xargs -r docker volume rm

以上是关于sh update_docker_images.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh sh_template.sh

sh sh.sh

Linux下面如何运行 SH文件

配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh

shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别

linux下sh文件的运行