1. 安装
-
Update the package list:
1
sudo apt update
-
Install required packages:
1 2 3 4 5 6
sudo apt install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release
-
Add Docker’s official GPG key:
1
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
-
Add the stable Docker repository:
1 2 3 4
echo \ "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
Update the package list again:
1
sudo apt update
-
Install Docker:
1
sudo apt install -y docker-ce docker-ce-cli containerd.io
-
Verify that Docker is installed:
1
sudo docker run hello-world
2. 运行
-
Pull the Docker image:
1
docker pull chenzhaoyu94/chatgpt-web
-
Run the container:
1
docker run -p 8000:8000 chenzhaoyu94/chatgpt-web
-
Other commands:
1 2 3 4 5
# 前台运行 docker run --name chatgpt-web --rm -it -p 3002:3002 --env OPENAI_API_KEY=your_api_key chatgpt-web # 后台运行 docker run --name chatgpt-web -d -p 3002:3002 --env OPENAI_API_KEY=your_api_key chatgpt-web