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)的更多相关文章

  1. docker安装并设置开机启动(Linux)

    docker 开机启动: systemctl enable docker 使用的linux系统为CentOS7.2 docker分为CE和EE版本,EE版本收费,一般我们使用CE版本就满足要求了 do ...

  2. CentOS7 nginx 最简单的安装以及设置开机启动

    1. 下载tar包. 2. 解压缩tar包 3. 安装必须的部分 yum包 yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd ...

  3. docker容器怎么设置开机启动

    https://my.oschina.net/lwenhao/blog/1923003 docker服务器.以及容器设置自动启动 一.docker服务设置自动启动 说明:适用于yum安装的各种服务 查 ...

  4. 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 ...

  5. centos7安装redis设置开机启动

    1. 首先下载redis源码,并使用tar进行解压缩 wget http://download.redis.io/releases/redis-4.0.8.tar.gztar xvzf redis-4 ...

  6. CentOS7.3编译安装Nginx设置开机启动

    起因 最近想玩nginx了,本来用yum -y install nginx安装也启动好了,但是买了本<Nginx高性能Web服务器详解>,我咋能辜负我的书费呢?于是我就直接ps -ef | ...

  7. docker中怎样设置开机启动--随容器的启动而启动服务?

    docker可以说给我们的部署带来极大的方便和可逢凶化吉性!(懂的同学自然懂) 在初步了解之后,我们就能简单使用docker了. 刚开始玩docker时,可以基于系统级别的镜像做定制,比如基于  ce ...

  8. redis安装并设置开机启动

    1.下载并上传redis安装包至linux服务器目录:/usr/local/redis. 2.解压:tar -zxvf redis-5.0.7.tar.gz 3.编译安装:make && ...

  9. centos7安装docker并设置开机启动

    版本要求:查看内核版本,需大于3.10 [root@localhost ~]# uname -r -.el7.x86_64 更新内核:如果是生产机器务必慎重更新内核,避免出现不必要的问题. sudo ...

随机推荐

  1. nginx 设置静态下载界面

    首先,官方设置链接:https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/ 下面贴一个配置文件: cha ...

  2. Hadoop_01_Apache Hadoop概述

    一:Hadoop(Hadoop Distributed File System)概述:对海量数据分析处理的工具 1. Hadoop是Apache旗下的一个用java语言实现开源软件框架,是一个开发和运 ...

  3. BAT脚本批量调用Sql执行文件 (SqlServer 数据库)

    @echo off & setlocal EnableDelayedExpansion set num=0set INSTANCE_HOSTNAME= 地址set INSTANCE_PORT= ...

  4. P4016 负载平衡问题(最小费用最大流)

    P4016 负载平衡问题 题目描述 GG 公司有 nn 个沿铁路运输线环形排列的仓库,每个仓库存储的货物数量不等.如何用最少搬运量可以使 nn 个仓库的库存数量相同.搬运货物时,只能在相邻的仓库之间搬 ...

  5. KeyboardEvent keyCode Property

    Definition and Usage The keyCode property returns the Unicode character code of the key that trigger ...

  6. 01—EF开山篇,ORM介绍

    我是2014年接触的EF,用了一年多,感觉非常的方便,现在的公司没有使用,最近有朋友接了两个项目找我帮忙,都想使用EF,自己也有断时间没有使用,借着这个机会复习下.Entity Framework,简 ...

  7. Xftp6 和 Xshell 6 下载与安装使用

    官网地址:https://www.netsarang.com/zh/all-downloads/ 然后进行安装吧,基本没有什么配置. 打开 xftp 连接 Linux,进行文件操作. 然后 名称:随意 ...

  8. kickstart批量装机脚本

    #!/bin/bash #安装必备的软件 yum -y install dhcp tftp-server tftp xinetd syslinux vsftpd yum -y install *kic ...

  9. C# ado.net DataSet使用(五)

    一.填充dataset class Program { private static string constr = "server=.;database=northwnd;integrat ...

  10. 简单了解学习PHP(针对前端开发)

    1.服务器(服务器系统) 通常是指较强的计算能力能够同时服务多人的计算机 常见的服务器操作系统: 1.各个版本的Linux操作系统 2.乌班图.centos 3.mac  os(苹果) 4.windo ...