Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
deploy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
public
deploy
Commits
b7c71bbf
Commit
b7c71bbf
authored
May 22, 2024
by
蔡润涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
c823bd60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
install-docker-debian_or_ubuntu.sh
install-docker-debian_or_ubuntu.sh
+33
-0
No files found.
install-docker-debian_or_ubuntu.sh
0 → 100644
View file @
b7c71bbf
#!/bin/bash
# 更新 package 索引
sudo
apt-get update
-y
# 安装必要的软件包
sudo
apt-get install
-y
\
apt-transport-https
\
ca-certificates
\
curl
\
gnupg
\
lsb-release
# 添加 Docker 的官方 GPG 密钥
curl
-fsSL
https://download.docker.com/linux/debian/gpg |
sudo
gpg
--dearmor
-o
/usr/share/keyrings/docker-archive-keyring.gpg
# 设置稳定版本的 Docker APT 源
echo
"deb [arch=
$(
dpkg
--print-architecture
)
signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian
$(
lsb_release
-cs
)
stable"
|
sudo
tee /etc/apt/sources.list.d/docker.list
>
/dev/null
# 更新 package 索引
sudo
apt-get update
-y
# 安装最新版本的 Docker 引擎、CLI 和 containerd
sudo
apt-get install
-y
docker-ce docker-ce-cli containerd.io
# 启动并且启用 Docker 服务
sudo
systemctl start docker
sudo
systemctl
enable
docker
# 验证 Docker 是否安装成功
sudo
docker
--version
echo
"Docker 已成功安装并正在运行。"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment