docker安装并设置开机启动(CentOS7/8)
CentOS7.2

docker分为CE和EE版本,EE版本收费,一般我们使用CE版本就满足要求了
docker安装及启动
docker安装很简单,直接使用如下命令安装即可,安装后的docker版本即为CE免费版(对于更高的linux版本,可以先执行安装docker-ce,如果提示Nothing to do,则再直接使用如下命令)
yum -y install docker
安装结束后,查看docker运行状态

启动docker

查看/var/log/messages日志,扎到如下错误信息
Aug :: localhost dockerd-current: Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker (--selinux-enabled=false)
根据错误提示,修改docker配置文件,设置--selinux-enabled=false
vim /etc/sysconfig/docker

保存后,重新启动docker,查看启动状态

设置docker开机启动
docker安装之后,已经安装了开机启动service文件,但还需要在设置下开机启动,才能在服务器重启时自动启动
systemctl enable docker

CentOS8
查询docker
系统版本为Basic Web Server
[root@localhost ~]# yum search docker
Last metadata expiration check: :: ago on Sun Oct :: AM CST.
============================================================================== Summary & Name Matched: docker ===============================================================================
podman-docker.noarch : Emulate Docker CLI using podman
podman-docker.noarch : Emulate Docker CLI using podman
pcp-pmda-docker.x86_64 : Performance Co-Pilot (PCP) metrics from the Docker daemon
================================================================================== Summary Matched: docker ==================================================================================
oci-umount.x86_64 : OCI umount hook for docker
oci-systemd-hook.x86_64 : OCI systemd hook for docker
oci-systemd-hook.x86_64 : OCI systemd hook for docker
skopeo.x86_64 : Inspect Docker images and repositories on registries
这里没有我们想要的docker-ce
下载docker-ce repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
安装docker
[root@localhost ~]# yum -y install docker-ce
Docker CE Stable - x86_64 6.5 kB/s | kB :
Error:
Problem: package docker-ce-:19.03.-.el7.x86_64 requires containerd.io >= 1.2.-, but none of the providers can be installed
- cannot install the best candidate for the job
- package containerd.io-1.2.-3.2.el7.x86_64 is excluded
- package containerd.io-1.2.-3.3.el7.x86_64 is excluded
- package containerd.io-1.2.-.el7.x86_64 is excluded
- package containerd.io-1.2.-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.-3.3.el7.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
提示信息中告诉我们需要containerd.io依赖
yum -y install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
再次安装docker(如果在安装docker-ce repo之前执行过yum -y install docker,则需要先执行yum remove docker卸载)
yum -y install docker-ce
启动docker
systemctl start docker
加入开机启动
systemctl enable docker
systemctl daemon-reload
查看docker版本
[root@localhost ~]# docker version
Client: Docker Engine - Community
Version: 19.03.
API version: 1.40
Go version: go1.12.10
Git commit: a872fc2f86
Built: Tue Oct ::
OS/Arch: linux/amd64
Experimental: false Server: Docker Engine - Community
Engine:
Version: 19.03.
API version: 1.40 (minimum version 1.12)
Go version: go1.12.10
Git commit: a872fc2f86
Built: Tue Oct ::
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.
GitCommit: fec3683
到此docker就安装完成了
docker安装并设置开机启动(CentOS7/8)的更多相关文章
- docker安装并设置开机启动(Linux)
docker 开机启动: systemctl enable docker 使用的linux系统为CentOS7.2 docker分为CE和EE版本,EE版本收费,一般我们使用CE版本就满足要求了 do ...
- CentOS7 nginx 最简单的安装以及设置开机启动
1. 下载tar包. 2. 解压缩tar包 3. 安装必须的部分 yum包 yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd ...
- docker容器怎么设置开机启动
https://my.oschina.net/lwenhao/blog/1923003 docker服务器.以及容器设置自动启动 一.docker服务设置自动启动 说明:适用于yum安装的各种服务 查 ...
- Linux上安装ZooKeeper并设置开机启动(CentOS7+ZooKeeper3.4.10)
1下载Zookeeper 2安装启动测试 2.1上载压缩文件并解压 2.2新建 zookeeper配置文件 2.3安装JDK 2.4启动zookeeper 2.5查看zookeeper的状态 3将Zo ...
- centos7安装redis设置开机启动
1. 首先下载redis源码,并使用tar进行解压缩 wget http://download.redis.io/releases/redis-4.0.8.tar.gztar xvzf redis-4 ...
- CentOS7.3编译安装Nginx设置开机启动
起因 最近想玩nginx了,本来用yum -y install nginx安装也启动好了,但是买了本<Nginx高性能Web服务器详解>,我咋能辜负我的书费呢?于是我就直接ps -ef | ...
- docker中怎样设置开机启动--随容器的启动而启动服务?
docker可以说给我们的部署带来极大的方便和可逢凶化吉性!(懂的同学自然懂) 在初步了解之后,我们就能简单使用docker了. 刚开始玩docker时,可以基于系统级别的镜像做定制,比如基于 ce ...
- redis安装并设置开机启动
1.下载并上传redis安装包至linux服务器目录:/usr/local/redis. 2.解压:tar -zxvf redis-5.0.7.tar.gz 3.编译安装:make && ...
- centos7安装docker并设置开机启动
版本要求:查看内核版本,需大于3.10 [root@localhost ~]# uname -r -.el7.x86_64 更新内核:如果是生产机器务必慎重更新内核,避免出现不必要的问题. sudo ...
随机推荐
- element ui的照片墙 默认显示照片
参考地址: element ui的照片墙 默认显示照片 照片显示的数据格式是:[{name: '', url: ''}],:file-list=""默认显示的图片 实际项目开发中需 ...
- Jerry和您聊聊Chrome开发者工具
Chrome开发者工具是Jerry日常工作使用的三大调试器之一.虽然工具名称前面带了个"开发者", 但是它对非开发人员仍然有用.不信? 用Chrome打开我们常用的网站,按F12, ...
- SSISDB8:查看SSISDB记录Package执行的消息
在执行Package时,SSISDB都会创建唯一的OperationID 和 ExecutionID,标识对package执行的操作和执行实例(Execution Instance),并记录opera ...
- paypal支付 NVP支付 paypal 手续费 GetTransactionDetails
主要内容: 本文章主要讲解的是NVP的对接,以最简单的接口案例,讲解一下对接NVP的方案. 先提供下paypal 官方文档的主要功能对接说明,如下 1.请求API 服务器端点 描述 https://a ...
- (十五)连接网络adb,android模拟器打开
第一步:Android开发板连接usb和网线 adb shell setprop service.adb.tcp.port 5555 adb shell stop adbdadb shell star ...
- css优化和重排
转:http://caibaojian.com/css-reflow-repaint.html
- MyBatis-07-分页
7.分页 思考:为什么要分页? 减少数据的处理量 7.1.使用Limit分页 select * from user limit startIndex,pageSize 使用Mybatis实现分页,核心 ...
- ProjectEuler215 Crack-free Walls
易知状态不会太多(\(3329\)个),直接搜一下,按照能不能连在后面建边,跑一遍dp即可 #include <bits/stdc++.h> using namespace std; st ...
- mysql5.7安装中的问题(服务无法启动。服务没有报告任何错误。排查方法)
1.拒绝访问的问题 权限不够,必须以管理员身份启动命令行 2.MySQL 服务无法启动.服务没有报告任何错误. 进入到你的mysql安装目录,C:\Program Files\MySQL\MySQL ...
- crontab踩坑(一)
因为 我们用conda托管了python虚拟环境,我自身的环境是wqbin,本来crontab脚本的命令是如下: 发生了如下的报错: 因为这里的环境是启动的是base的 所以找不相应的模块.于是我在执 ...