2024-07-23 20:50:16 +08:00
|
|
|
|
#!/bin/bash
|
2024-07-24 12:50:44 +08:00
|
|
|
|
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
|
2024-07-24 18:41:04 +08:00
|
|
|
|
sudo docker compose up -d || "安装失败" $$ exit
|
|
|
|
|
declare password=$( sudo docker exec -it alist ./alist admin random | grep password | awk '{print $4}')
|
2024-07-24 12:50:44 +08:00
|
|
|
|
echo "账号:admin"
|
|
|
|
|
echo "密码:${password}"
|