随笔 - 92  文章 - 0  评论 - 13  阅读 - 17万

CentOS/Ubuntu 安装 Docker和Portainer

在两个环境下安装了Docker及Portainer,记录下以供日后查阅

CentOS7部分

1.清理旧版本

$ sudo yum remove docker \
              docker-client \
              docker-client-latest \
              docker-common \
              docker-latest \
              docker-latest-logrotate \
              docker-logrotate \
              docker-engine

2.加repository

$ sudo yum install -y yum-utils

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

3.通过repository安装

$ sudo yum install docker-ce docker-ce-cli containerd.io
$ sudo systemctl start docker

3.1.通过rmp包安装(本人未执行)

$ sudo yum install /path/to/package.rpm
$ sudo systemctl start docker

4.安装Portainer

$ docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

5.访问

http://YOUR-DOCKER-HOST:9000

UBUNTU部分

1.更新

# sudo apt-get update -y

2.安装Docker

# sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y

3.安装gpg-key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
sudo apt-key fingerprint 0EBFCD88

4.更新源

# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# sudo apt-get update -y
# sudo apt-get install docker-ce -y

5.安装Portainer

# docker volume create portainer_data
# docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

6.访问

http://YOUR-DOCKER-HOST:9000

 

参考:https://www.chucklindblom.com/centos-install-docker-portainer/

https://www.hostnextra.com/kb/how-to-install-portainer-on-ubuntu/

https://docs.fuga.cloud/how-to-install-portainer-docker-ui-manager-on-ubuntu-20.04-18.04-16.04

posted on   BoneKing  阅读(567)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示