笔者为了使用Docker安装Gitlab CE,在新增阿里云服务器上搭建Docker,并且考虑GitLab端口使用的原因,对有关基础功能端口进行修改(例如SSH[22])。本教程默认使用root,如果非root用户请在操作命令前加sudo。
更新系统:yum update
安装Screen:yum install screen
(笔者习惯使用Screen,避免网络掉线)
创建Screen:screen -S docker
Q:No match for argument: screen
A:Centos8安装screen需要使用epel来安装,安装epel后,再安装screen,解决centos8无法安装screen的问题。yum install epel-release
Mirror:
- https://mirrors.tuna.tsinghua.edu.cn/ 清华大学开源软件镜像站
- https://developer.aliyun.com/mirror/ 阿里巴巴开源镜像站
1. 解决部分依赖和工具
yum install -y yum-utils device-mapper-persistent-data lvm2
2.添加软件源信息
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.更新软件源信息
yum makecache
4.安装Docker CE
yum -y install docker-ce
Q: Error: Problem: package docker-ce-3:19.03.8-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
A: 安装新版containerd.io
yum install -y https://mirror.aliyun.com/dockerce/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
5.安装完成启动docker
service docker start
设置开机启动:systemctl enable docker
文章评论