docker学习笔记002-docker-engine安装过程

简介: docker学习笔记0002,docker-engine安装过程

虚拟机内核版本:

Linux SHDL009020142 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

采用手动安装方式,安装docker-engine


直接下载文件安装

[baseuser@SHDL009020139 ~]$ wget https://yum.dockerproject.org/repo/main/centos/6/Packages/docker-engine-1.7.1-1.el6.x86_64.rpm

 

安装依赖

[baseuser@SHDL009020139 ~]$ sudo yum install -y libcgroup-*

[baseuser@SHDL009020139 ~]$ rpm -ivh docker-engine-1.7.1-1.el6.x86_64.rpm

warning: docker-engine-1.7.1-1.el6.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 2c52609d: NOKEY

error: Failed dependencies:

xz is needed by docker-engine-1.7.1-1.el6.x86_64

 

报错提示安装依赖XZ

[baseuser@SHDL009020139 ~]$ yum search xz

Loaded plugins: product-id, search-disabled-repos, subscription-manager

=========================================================== N/S Matched: xz ===========================================================

xz.x86_64 : LZMA compression utilities

xz-devel.i686 : Devel libraries & headers for liblzma

xz-devel.x86_64 : Devel libraries & headers for liblzma

xz-libs.i686 : Libraries for decoding LZMA compression

xz-libs.x86_64 : Libraries for decoding LZMA compression

xz-lzma-compat.x86_64 : Older LZMA format compatibility binaries

 

  Name and summary matches only, use "search all" for everything.

 

[baseuser@SHDL009020139 ~]$ sudo yum install -y xz-*

 

[baseuser@SHDL009020139 ~]$ rpm -ivh docker-engine-1.7.1-1.el6.x86_64.rpm

warning: docker-engine-1.7.1-1.el6.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 2c52609d: NOKEY

error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)

[baseuser@SHDL009020139 ~]$ sudo rpm -ivh docker-engine-1.7.1-1.el6.x86_64.rpm

warning: docker-engine-1.7.1-1.el6.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 2c52609d: NOKEY

Preparing...                ########################################### [100%]

   1:docker-engine          ########################################### [100%]

查询已安装的docker

[baseuser@SHDL009020139 ~]$ yum list installed | grep docker

docker-engine.x86_64                 1.7.1-1.el6                      installed

[baseuser@SHDL009020139 ~]$

 

[baseuser@SHDL009020139 ~]$ ps -ef|grep docker

baseuser  4460  3491  0 11:43 pts/0    00:00:00 grep docker

[baseuser@SHDL009020139 ~]$ sudo service docker start

[sudo] password for baseuser:

Starting cgconfig service:                                 [  OK  ]

Starting docker:                                           [  OK  ]

[baseuser@SHDL009020139 ~]$ ps -ef|grep docker

root      4506     1  2 11:44 pts/0    00:00:00 /usr/bin/docker -d

baseuser  4622  3491  0 11:44 pts/0    00:00:00 grep docker

 

[baseuser@SHDL009020139 ~]$ sudo docker run hello-world

 

Hello from Docker!

This message shows that your installation appears to be working correctly.

 

To generate this message, Docker took the following steps:

 1. The Docker client contacted the Docker daemon.

 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

 3. The Docker daemon created a new container from that image which runs the

    executable that produces the output you are currently reading.

 4. The Docker daemon streamed that output to the Docker client, which sent it

    to your terminal.

 

To try something more ambitious, you can run an Ubuntu container with:

 $ docker run -it ubuntu bash

 

Share images, automate workflows, and more with a free Docker ID:

 https://cloud.docker.com/

 

For more examples and ideas, visit:

 https://docs.docker.com/engine/userguide/

 

 

 

[baseuser@SHDL009020139 ~]$ sudo docker ps -a

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES

e5f07cbd2647        hello-world         "/hello"            33 seconds ago      Exited (0) 32 seconds ago                       grave_turing

 

[baseuser@SHDL009020139 ~]$ docker version

Client version: 1.7.1

Client API version: 1.19

Go version (client): go1.4.2

Git commit (client): 786b29d

OS/Arch (client): linux/amd64

Server version: 1.7.1

Server API version: 1.19

Go version (server): go1.4.2

Git commit (server): 786b29d

OS/Arch (server): linux/amd64

[baseuser@SHDL009020139 ~]$

 

卸载

[baseuser@SHDL009020139 ~]$ yum list installed | grep docker

docker-engine.x86_64                 1.7.1-1.el6                      installed

删除安装包

[baseuser@SHDL009020139 ~]$ sudo yum -y remove docker-engine.x86_64

[baseuser@SHDL009020139 ~]$ yum list installed | grep docker

[baseuser@SHDL009020139 ~]$

 

 以上安装过程。


目录
相关文章
|
21天前
|
弹性计算 Ubuntu Linux
阿里云服务器一键安装Docker社区版教程,基于系统运维管理OOS
阿里云服务器一键安装Docker社区版教程,基于系统运维管理OOS自动化部署。支持Ubuntu 22.04/20.04、CentOS 7.7-7.9及Alibaba Cloud Linux 3.2104 LTS。前提条件:ECS实例需运行中且有公网。步骤:选择Docker扩展并安装,验证成功通过命令`docker -v`查看版本号。
219 79
|
1月前
|
NoSQL 关系型数据库 应用服务中间件
docker基础篇:安装tomcat
docker基础篇:安装tomcat
172 64
|
8天前
|
前端开发 应用服务中间件 nginx
docker安装nginx,前端项目运行
通过上述步骤,你可以轻松地在Docker中部署Nginx并运行前端项目。这种方法不仅简化了部署流程,还确保了环境的一致性,提高了开发和运维的效率。确保按步骤操作,并根据项目的具体需求进行相应的配置调整。
55 25
|
8天前
|
安全 数据安全/隐私保护 Docker
docker私有仓库harbor安装
通过以上步骤,您可以成功在企业内部安装和配置Harbor私有仓库,方便地管理和分发Docker镜像。Harbor不仅提供了基础的镜像管理功能,还增强了安全性、身份管理和审计功能,使其成为企业级容器镜像管理的理想选择。
60 22
|
24天前
|
NoSQL 关系型数据库 Redis
《docker高级篇(大厂进阶):1.Docker复杂安装详说》包括:安装mysql主从复制、安装redis集群
《docker高级篇(大厂进阶):1.Docker复杂安装详说》包括:安装mysql主从复制、安装redis集群
97 14
|
21天前
|
关系型数据库 MySQL 应用服务中间件
《docker基础篇:8.Docker常规安装简介》包括:docker常规安装总体步骤、安装tomcat、安装mysql、安装redis
《docker基础篇:8.Docker常规安装简介》包括:docker常规安装总体步骤、安装tomcat、安装mysql、安装redis
79 7
|
1月前
|
关系型数据库 MySQL 数据库
docker高级篇(大厂进阶):安装mysql主从复制
docker高级篇(大厂进阶):安装mysql主从复制
120 24
|
1月前
|
NoSQL 算法 Redis
docker高级篇(大厂进阶):安装redis集群
docker高级篇(大厂进阶):安装redis集群
128 24
|
1月前
|
Ubuntu Linux Docker
Ubuntu22.04上Docker的安装
通过以上详细的安装步骤和命令,您可以在Ubuntu 22.04系统上顺利安装
940 12
|
2月前
|
缓存 Linux Docker
【最新版正确姿势】Docker安装教程(简单几步即可完成)
之前的老版本Docker安装教程已经发生了变化,本文分享了Docker最新版安装教程,其他操作系统版本也可以参考官 方的其他安装版本文档。
2769 3
【最新版正确姿势】Docker安装教程(简单几步即可完成)

热门文章

最新文章