Created
April 24, 2024 07:10
-
-
Save Serlight/1788f854a45b3cb36cd222930f9bb0d1 to your computer and use it in GitHub Desktop.
vps grass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Remove existing Docker packages | |
apt-get remove -y docker \ | |
docker.io | |
# Install required dependencies | |
apt-get update | |
apt-get install -y apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
# Add Docker repository and update repository URL | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
# Update repository cache | |
apt-get update | |
# Install Docker | |
apt-get install -y docker-ce | |
# Start Docker service | |
systemctl start docker | |
# Optional: Enable Docker to start on boot | |
systemctl enable docker | |
docker pull camislav/grass | |
docker run -d --name Grass -p 8080:80 -e GRASS_USE=$grass_account -e GRASS_PASS=$grass_password camislav/grass | |
echo "Docker installation and configuration completed successfully." | |
# export grass_account=账号 | |
# export grass_password=密码 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment