install docker

官网安装地址

https://docs.docker.com/engine/installation/linux/centos/

先找官网 是个不错的思路

这里只贴yum安装的方法


install with yum 


1.登录的用户用户需要有sudo 权限或者是root

2.更新系统的包,尽量都保持最新的

3.内核最好大于等于3.10.x,如果小于比较麻烦,这里不做介绍

以下我均是直接用root操作的,非root用户执行命令加sudo

4.添加yum源

直接复制粘贴回车即可,不用创建文件

$ sudo tee /etc/yum.repos.d/docker.repo <<-‘EOF‘
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

5.安装docker的包

yum  -y install docker-engine

6.启动docker

  这里的启动方式是centos7的

  添加为系统服务

systemctl enable docker.service

 启动

systemctl start docker

7.验证安装正确性

命令可以用就可以了

docker run --rm hello-world

非root用户继续往下看

8.非root用户,多一步

  非root,总是得加sudo,简化如下

   以下我均是直接用root操作的,非root用户执行命令加sudo

  • 创建docker组
groupadd docker
  • 将你的用户加入docker组
usermod -aG docker your_username

这个搞完后。需要登出登入一次生效,然后执行docker的命令就不用加sudo了

到此为止安装好了

安装报错的解决

报错如下

Transaction check error:

file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

file /usr/sbin/blkdeactivate from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

file /usr/share/man/man8/blkdeactivate.8.gz from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

Error Summary

解决方法

yum install libdevmapper* -y
时间: 2024-10-15 12:16:57

install docker的相关文章

Install Docker on Mac OS X(转)

Install Docker on Mac OS X You can install Docker using Boot2Docker to run docker commands at your command-line. Choose this installation if you are familiar with the command-line or plan to contribute to the Docker project on GitHub. Alternatively,

install docker on centos7

copy from:https://www.youtube.com/watch?v=pm55BUwQ0iE # Prerequisites - Kernel must be 3.10 at minimum - For checking kernel version, use this command: uname -r # Add Docker's repository - Create file docker.repo and save it in /etc/yum.repos.d/ sudo

Ubuntu install Docker

首先需要说明的是,根据Docker的官方文档,Docker的安装必须在64位的机子上.这里只说明Ubuntu 14.04与16.04,我成功安装成功过Ubuntu 14.04,16.04还没有测试过,若为Ubuntu 12.04参考官方文档. 官方文档地址:https://docs.docker.com/engine/installation/linux/ubuntulinux/ 建议先按照官方文档步骤安装,若读不懂可以参考我写的,有问题请给我留言 -----------------------

Install Docker on Mac OS X

小白来山寨一把官网文档. Docker不能直接跑在OS X上,需要先安装下VirtualBox和boot2docker.boot2docker会帮我们启动vm,启动docker,并且本身提供一些管理命令. boot2docker也很轻量级,完全在内存里启动一个VM,只占24M大小,几秒内就可以启动. 安装过程 1) 下载VirtualVM-xxx-xxx.dmg,并安装. 2) 使用brew安装boot2docker以及docker brew install boot2docker brew i

centos Install Docker

安装必备软件 yum -y install iptables  iptables-services net-tools vim wget 安装Dockeryum -y install docker 下载centos镜像docker pull centos 查看centos 镜像docker images centos 运行一个Docker容器docker run -i -t centos /bin/bash 搜索Ubuntu镜像docker search Ubuntu 显示正在运行的容器(需要先

How to install Docker on Ubuntu

Docker currently only runs on 64-bits platforms and requires that the kernal version be no less than 3.10.in this tutorial , i use ubuntu 16.04 and the kernal version is 4.13.0-43-generic you can use this command to find your linux-version and linux-

Docker 0x03:Install Docker

目录 Install Docker Centos yum 安装 运行docker-daemon并开机自启动 运行hello-world应用docker容器中 Ubn Install Docker docker现在分Moby,Docker CE 和Docker EE.由于docker开源后,将docker开源项目变为了Moby项目.对于想开发docker的人现在转移到Moby,而对于我们使用docker的用户,即再docker上有的应用开发和维护,还是关注docker EE. Centos yum

How To Install Docker On Ubuntu 18.04

Docker is an increasingly popular software package that creates a container for application development. Developing in Docker speeds up applications, as it shares the kernel and other resources, instead of requiring dedicated resources. There are two

[Docker] Install Docker on Windows (hp) and start with Kitematic

Well, on Windows costs a little bit effort to run docker. 1. You need to enable Virtulization: Oh hp Windows machine, you need to Turn off you laptop Start it and click 'esc' repeatly Until if jumps a menu, you click F10 to enter 'BIOS setting' Then