Centos 7安装docker的日志

来源:互联网 发布:不配说爱我dj网络歌手 编辑:程序博客网 时间:2024/05/17 01:59

[fb@localhost ~]$ su
Password:
[root@localhost fb]# yum install docker
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 11577.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 131 M RSS (1.0 GB VSZ)
Started: Sat Sep 3 09:57:26 2016 - 12:02 ago
State : Sleeping, pid: 11577
^C
Exiting on user cancel.
[root@localhost fb]# rm -f /var/run/yum.pid 出问题了,百度的解决方案
[root@localhost fb]# yum install docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Resolving Dependencies
–> Running transaction check
—> Package docker.x86_64 0:1.10.3-46.el7.centos.10 will be installed
–> Processing Dependency: docker-common = 1.10.3-46.el7.centos.10 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Processing Dependency: oci-systemd-hook >= 1:0.1.4-4 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Processing Dependency: oci-register-machine >= 1:0-1.7 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Processing Dependency: docker-selinux >= 1.10.3-46.el7.centos.10 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Running transaction check
—> Package docker-common.x86_64 0:1.10.3-46.el7.centos.10 will be installed
—> Package docker-selinux.x86_64 0:1.10.3-46.el7.centos.10 will be installed
—> Package oci-register-machine.x86_64 1:0-1.7.git31bbcd2.el7 will be installed
—> Package oci-systemd-hook.x86_64 1:0.1.4-4.git41491a3.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository

Size

Installing:
docker x86_64 1.10.3-46.el7.centos.10 extras 9.5 M
Installing for dependencies:
docker-common x86_64 1.10.3-46.el7.centos.10 extras 61 k
docker-selinux x86_64 1.10.3-46.el7.centos.10 extras 78 k
oci-register-machine x86_64 1:0-1.7.git31bbcd2.el7 extras 929 k
oci-systemd-hook x86_64 1:0.1.4-4.git41491a3.el7 extras 27 k

Transaction Summary

Install 1 Package (+4 Dependent packages)

Total download size: 11 M
Installed size: 48 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/oci-systemd-hook-0.1.4-4.git41491a3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for oci-systemd-hook-0.1.4-4.git41491a3.el7.x86_64.rpm is not installed
(1/5): oci-systemd-hook-0.1.4-4.git41491a3.el7.x86_64.rpm | 27 kB 00:01
(2/5): docker-common-1.10.3-46.el7.centos.10.x86_64.rpm | 61 kB 00:03
(3/5): docker-selinux-1.10.3-46.el7.centos.10.x86_64.rpm | 78 kB 00:03
(4/5): oci-register-machine-0-1.7.git31bbcd2.el7.x86_64.rp | 929 kB 00:19

(5/5): docker-1.10.3-46.el7.centos.10.x86_64.rpm | 9.5 MB 01:21

Total 132 kB/s | 11 MB 01:21
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : “CentOS-7 Key (CentOS 7 Official Signing Key) security@centos.org”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:oci-register-machine-0-1.7.git31bbcd2.el7.x86_64 1/5
Installing : docker-selinux-1.10.3-46.el7.centos.10.x86_64 2/5
Installing : 1:oci-systemd-hook-0.1.4-4.git41491a3.el7.x86_64 3/5
Installing : docker-common-1.10.3-46.el7.centos.10.x86_64 4/5
Installing : docker-1.10.3-46.el7.centos.10.x86_64 5/5
Verifying : docker-common-1.10.3-46.el7.centos.10.x86_64 1/5
Verifying : docker-1.10.3-46.el7.centos.10.x86_64 2/5
Verifying : 1:oci-systemd-hook-0.1.4-4.git41491a3.el7.x86_64 3/5
Verifying : docker-selinux-1.10.3-46.el7.centos.10.x86_64 4/5
Verifying : 1:oci-register-machine-0-1.7.git31bbcd2.el7.x86_64 5/5

Installed:
docker.x86_64 0:1.10.3-46.el7.centos.10

Dependency Installed:
docker-common.x86_64 0:1.10.3-46.el7.centos.10
docker-selinux.x86_64 0:1.10.3-46.el7.centos.10
oci-register-machine.x86_64 1:0-1.7.git31bbcd2.el7
oci-systemd-hook.x86_64 1:0.1.4-4.git41491a3.el7

Complete!完成安装
**[root@localhost fb]# systemctl start docker.service
[root@localhost fb]# systemctl enable docker.service**启动服务,并添加开机启动
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost fb]# docker info查看docker信息
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.10.3
Storage Driver: devicemapper
Pool Name: docker-8:3-36874681-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 14.18 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.107-RHEL7 (2015-10-14)
Execution Driver: native-0.2
Logging Driver: journald
Plugins:
Volume: local
Network: null host bridge
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 1
Total Memory: 1.782 GiB
Name: localhost.localdomain
ID: 5SBV:WB7Y:JTF6:N3ZJ:MQZS:MWEH:TYPX:KIOV:BEO3:Q3JM:R4XB:UGP6
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Registries: docker.io (secure)
[root@localhost fb]# docker run -i -t centos /bin/bash 运行一个centos容器,不存在会自动从docker官网下载
Unable to find image ‘centos:latest’ locally
Trying to pull repository docker.io/library/centos …
latest: Pulling from docker.io/library/centos
3d8673bd162a: Downloading 7.559 MB/70.58 MB
等待下载完成,可能会被墙。
3d8673bd162a: Pull complete
Digest: sha256:a66ffcb73930584413de83311ca11a4cb4938c9b2521d331026dad970c19adf4
Status: Downloaded newer image for docker.io/centos:latest
[root@fb00d7386fca /]# cat /etc/redhat-release 成功安装并打开centos的容器
CentOS Linux release 7.2.1511 (Core)
[root@fb00d7386fca /]# 可以在这个容器里面安装软件
退出输入exit即可。

0 0
原创粉丝点击