侧边栏壁纸
博主头像
雾深的技术博客博主等级

行动起来,活在当下

  • 累计撰写 9 篇文章
  • 累计创建 7 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Docker安装教程

Woolsen
2023-11-29 / 0 评论 / 0 点赞 / 59 阅读 / 3031 字

安装方法

官方教程

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg -y
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
​
# Add the repository to Apt sources:
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
​
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

通过Aliyun镜像安装

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/aliyun-docker.gpg
​
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/aliyun-docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
​
# 验证
sudo docker info

配置http私有仓库

sudo vim /etc/docker/daemon.json

# 添加以下内容
{
  "insecure-registries": [
    "192.168.2.210:5000"
  ]
}

配置镜像仓库

docker中科大镜像源:https://docker.mirrors.ustc.edu.cn

# 不存在可以新建一个
$ sudo vi /etc/docker/daemon.json

{
 "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

其他

k8s安装教程(ubuntu22.04): https://cloud.tencent.com/developer/article/2057996

# 授权docker权限给woolsen用户
sudo usermod -aG docker woolsen
 
# 运行kuboard
sudo docker run -d \  
    --restart=unless-stopped \  
    --name=kuboard \  
    -p 8008:80/tcp \  
    -p 10081:10081/tcp \  
    -e KUBOARD_ENDPOINT="http://192.168.2.210:80" \  
    -e KUBOARD_AGENT_SERVER_TCP_PORT="10081" \  
    -v /root/kuboard-data:/data \  
    eipwork/kuboard:v3

0

评论区