linuxtool/Config/Docker/Alist.sh

21 lines
471 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
declare path=$1
declare port=$2
cd $path
cat > "docker-compose.yml" << EOF
version: '3.8'
services:
alist:
image: xhofe/alist:latest
container_name: alist
restart: always
volumes:
- ./:/opt/alist/data
ports:
- "${port}:5244"
EOF
docker compose up -d || "安装失败" $$ exit
declare password=$( docker exec -it alist ./alist admin random | grep password | awk '{print $4}')
echo "账号admin"
echo "密码:${password}"