Update docker-install.sh

shfmt
This commit is contained in:
tteckster 2023-07-10 19:17:30 -04:00 committed by GitHub
parent 39ebf79a6d
commit 9189e12e48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@
# License: MIT # License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE # https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color color
verb_ip6 verb_ip6
catch_errors catch_errors
@ -32,20 +32,20 @@ msg_info "Installing Docker $DOCKER_LATEST_VERSION"
DOCKER_CONFIG_PATH='/etc/docker/daemon.json' DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
mkdir -p $(dirname $DOCKER_CONFIG_PATH) mkdir -p $(dirname $DOCKER_CONFIG_PATH)
if [ "$ST" == "yes" ]; then if [ "$ST" == "yes" ]; then
VER=$(curl -s https://api.github.com/repos/containers/fuse-overlayfs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') VER=$(curl -s https://api.github.com/repos/containers/fuse-overlayfs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
cd /usr/local/bin cd /usr/local/bin
curl -sSL -o fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/$VER/fuse-overlayfs-x86_64 curl -sSL -o fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/$VER/fuse-overlayfs-x86_64
chmod 755 /usr/local/bin/fuse-overlayfs chmod 755 /usr/local/bin/fuse-overlayfs
cd ~ cd ~
echo -e '{\n "storage-driver": "fuse-overlayfs",\n "log-driver": "journald"\n}' > /etc/docker/daemon.json echo -e '{\n "storage-driver": "fuse-overlayfs",\n "log-driver": "journald"\n}' >/etc/docker/daemon.json
else else
echo -e '{\n "log-driver": "journald"\n}' > /etc/docker/daemon.json echo -e '{\n "log-driver": "journald"\n}' >/etc/docker/daemon.json
fi fi
$STD sh <(curl -sSL https://get.docker.com) $STD sh <(curl -sSL https://get.docker.com)
msg_ok "Installed Docker $DOCKER_LATEST_VERSION" msg_ok "Installed Docker $DOCKER_LATEST_VERSION"
read -r -p "Would you like to add Portainer? <y/N> " prompt read -r -p "Would you like to add Portainer? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Portainer $PORTAINER_LATEST_VERSION" msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
docker volume create portainer_data >/dev/null docker volume create portainer_data >/dev/null
$STD docker run -d \ $STD docker run -d \
@ -59,7 +59,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION" msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
else else
read -r -p "Would you like to add the Portainer Agent? <y/N> " prompt read -r -p "Would you like to add the Portainer Agent? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION" msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION"
$STD docker run -d \ $STD docker run -d \
-p 9001:9001 \ -p 9001:9001 \
@ -72,7 +72,7 @@ else
fi fi
fi fi
read -r -p "Would you like to add Docker Compose? <y/N> " prompt read -r -p "Would you like to add Docker Compose? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION" msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins mkdir -p $DOCKER_CONFIG/cli-plugins