Docker

[root@localhost ~]# yum update

[root@localhost ~]# uname -r
3.10.0-327.el7.x86_64

Add repo for docker

vim /etc/yum.repos.d/docker.repo

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

[root@localhost ~]# yum install docker-engine
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.iitm.ac.in
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
Resolving Dependencies
–> Running transaction check
—> Package docker-engine.x86_64 0:1.11.2-1.el7.centos will be installed
–> Processing Dependency: docker-engine-selinux >= 1.11.2-1.el7.centos for package: docker-engine-1.11.2-1.el7.centos.x86_64
–> Running transaction check
—> Package docker-engine-selinux.noarch 0:1.11.2-1.el7.centos will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
docker-engine x86_64 1.11.2-1.el7.centos dockerrepo 13 M
Installing for dependencies:
docker-engine-selinux noarch 1.11.2-1.el7.centos dockerrepo 28 k

Transaction Summary
================================================================================
Install 1 Package (+1 Dependent package)

Total download size: 13 M
Installed size: 54 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/dockerrepo/packages/docker-engine-selinux-1.11.2-1.el7.centos.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID 2c52609d: NOKEY
Public key for docker-engine-selinux-1.11.2-1.el7.centos.noarch.rpm is not installed
(1/2): docker-engine-selinux-1.11.2-1.el7.centos.noarch.rp | 28 kB 00:00
(2/2): docker-engine-1.11.2-1.el7.centos.x86_64.rpm | 13 MB 00:04
——————————————————————————–
Total 3.2 MB/s | 13 MB 00:04
Retrieving key from https://yum.dockerproject.org/gpg
Importing GPG key 0x2C52609D:
Userid : “Docker Release Tool (releasedocker) <docker@docker.com>”
Fingerprint: 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
From : https://yum.dockerproject.org/gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : docker-engine-selinux-1.11.2-1.el7.centos.noarch 1/2
restorecon: lstat(/var/lib/docker) failed: No such file or directory
warning: %post(docker-engine-selinux-1.11.2-1.el7.centos.noarch) scriptlet failed, exit status 255
Non-fatal POSTIN scriptlet failure in rpm package docker-engine-selinux-1.11.2-1.el7.centos.noarch
Installing : docker-engine-1.11.2-1.el7.centos.x86_64 2/2
Verifying : docker-engine-selinux-1.11.2-1.el7.centos.noarch 1/2
Verifying : docker-engine-1.11.2-1.el7.centos.x86_64 2/2

Installed:
docker-engine.x86_64 0:1.11.2-1.el7.centos

Dependency Installed:
docker-engine-selinux.noarch 0:1.11.2-1.el7.centos

Complete!

[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service

[root@localhost ~]# service docker status
Redirecting to /bin/systemctl status docker.service
● docker.service – Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2016-07-25 10:55:12 IST; 2min 2s ago
Docs: https://docs.docker.com
Main PID: 17626 (docker)
Memory: 20.5M
CGroup: /system.slice/docker.service
├─17626 /usr/bin/docker daemon -H fd://
└─17629 docker-containerd -l /var/run/docker/libcontainerd/docker-containerd.sock –runtime docker-runc –start-timeout 2m

Jul 25 10:55:11 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:11.013227983+05:30″ level=info msg=”Default bridge (docker…ddress”
Jul 25 10:55:12 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:12.670875571+05:30″ level=warning msg=”mountpoint for pids… found”
Jul 25 10:55:12 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:12.673513909+05:30″ level=info msg=”Loading containers: start.”
Jul 25 10:55:12 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:12.673632168+05:30″ level=info msg=”Loading containers: done.”
Jul 25 10:55:12 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:12.673693951+05:30″ level=info msg=”Daemon has completed i…zation”
Jul 25 10:55:12 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:12.673727857+05:30″ level=info msg=”Docker daemon” commit=…=1.11.2
Jul 25 10:55:12 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
Jul 25 10:55:12 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:12.692310609+05:30″ level=info msg=”API listen on /var/run…r.sock”
Jul 25 10:55:26 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:26.142213892+05:30″ level=error msg=”Handler for POST /v1….latest”
Jul 25 10:55:34 localhost.localdomain docker[17626]: time=”2016-07-25T10:55:34+05:30″ level=error msg=”containerd: deleting container”…cesses”
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# docker run hello-world
Unable to find image ‘hello-world:latest’ locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest

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 Hub account:
https://hub.docker.com

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:26:32:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.64/24 brd 192.168.122.255 scope global dynamic ens3
valid_lft 3139sec preferred_lft 3139sec
inet6 fe80::5054:ff:fe26:32f2/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.124.1/24 brd 192.168.124.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 500
link/ether 52:54:00:41:9b:5d brd ff:ff:ff:ff:ff:ff
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 02:42:bd:6a:f5:a2 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:bdff:fe6a:f5a2/64 scope link
valid_lft forever preferred_lft forever


Another type of installation of docker through script
[root@localhost ~]# yum update

[root@localhost ~]# curl -fsSL https://get.docker.com/ >> docker.sh

docker
[root@localhost ~]# curl -fsSL https://get.docker.com/ | sh
Warning: the “docker” command appears to already exist on this system.

If you already have Docker installed, this script can cause trouble, which is
why we’re displaying this warning and provide the opportunity to cancel the
installation.

If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.

You may press Ctrl+C now to abort this script.
+ sleep 20
+ sh -c ‘sleep 3; yum -y -q install docker-engine’
Package docker-engine-1.11.2-1.el7.centos.x86_64 already installed and latest version
+ sh -c ‘docker version’
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:11 2016
OS/Arch: linux/amd64

Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:11 2016
OS/Arch: linux/amd64

If you would like to use Docker as a non-root user, you should now consider
adding your user to the “docker” group with something like:

sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

[root@localhost ~]# docker –version
Docker version 1.11.2, build b9f10c9

[root@localhost ~]# docker info
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 2
Server Version: 1.11.2
Storage Driver: devicemapper
Pool Name: docker-253:0-70575336-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: 311 MB
Data Space Total: 107.4 GB
Data Space Available: 14.59 GB
Metadata Space Used: 978.9 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 (2016-06-09)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host bridge null
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 993.1 MiB
Name: localhost.localdomain
ID: W2J5:SSZL:WVZN:PLZX:GHW5:6S4N:JIRU:2FXT:RA4L:4KGU:GUXA:D7IS
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
[root@localhost ~]# ls -l /var/lib/docker/
total 4
drwx——. 4 root root 4096 Jul 25 11:00 containers
drwx——. 5 root root 50 Jul 25 10:55 devicemapper
drwx——. 3 root root 25 Jul 25 10:55 image
drwxr-x—. 3 root root 18 Jul 25 10:55 network
drwx——. 2 root root 6 Jul 25 10:55 tmp
drwx——. 2 root root 6 Jul 25 10:55 trust
drwx——. 2 root root 24 Jul 25 10:55 volumes

[root@localhost ~]# cat /etc/system-release
CentOS Linux release 7.2.1511 (Core)

[root@localhost ~]# docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntu is a Debian-based Linux operating s… 4330 [OK]
ubuntu-upstart Upstart is an event-based replacement for … 65 [OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of of… 30 [OK]
torusware/speedus-ubuntu Always updated official Ubuntu docker imag… 26 [OK]
ubuntu-debootstrap debootstrap –variant=minbase –components… 25 [OK]
nickistre/ubuntu-lamp LAMP server on Ubuntu 8 [OK]
nuagebec/ubuntu Simple always updated Ubuntu docker images… 6 [OK]
nickistre/ubuntu-lamp-wordpress LAMP on Ubuntu with wp-cli installed 6 [OK]
nimmis/ubuntu This is a docker images different LTS vers… 5 [OK]
jordi/ubuntu Ubuntu Base Image 1 [OK]
admiringworm/ubuntu Base ubuntu images based on the official u… 1 [OK]
darksheer/ubuntu Base Ubuntu Image — Updated hourly 1 [OK]
webhippie/ubuntu Docker images for ubuntu 0 [OK]
uvatbc/ubuntu Ubuntu images with unprivileged user 0 [OK]
datenbetrieb/ubuntu custom flavor of the official ubuntu base … 0 [OK]
life360/ubuntu Ubuntu is a Debian-based Linux operating s… 0 [OK]
esycat/ubuntu Ubuntu LTS 0 [OK]
widerplan/ubuntu Our basic Ubuntu images. 0 [OK]
croscon/ubuntu Crosconized Ubuntu 0 [OK]
ustclug/ubuntu ubuntu image for docker with USTC mirror 0 [OK]
konstruktoid/ubuntu Ubuntu base image 0 [OK]
teamrock/ubuntu TeamRock’s Ubuntu image configured with AW… 0 [OK]
smartentry/ubuntu ubuntu with smartentry 0 [OK]
dorapro/ubuntu ubuntu image 0 [OK]
lynxtp/ubuntu https://github.com/lynxtp/docker-ubuntu 0 [OK]

[root@localhost ~]# docker search redhat
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
hjd48/redhat redhat6.3×86-64 images 8
aossama/redhat RHEL 7.0 3
fbascheper/redhat-jboss-eap Extensible RedHat JBoss EAP 2
startx/sv-nodejs Container providing nodejs application eng… 1 [OK]
startx/sv-php Container providing apache web server with… 1 [OK]
redhatqe4test/pulp-automation 0 [OK]
redhatqe/pulp-automation 0 [OK]
blackout/redhat Red Hat Enterprise Linux image 0
greenxmleigh/redhat 0
redhatqe/cfme_tests Fedora23 image with preconfigured cfme_tes… 0 [OK]
redhatqe/cfme_tests_base cfme_tests base image with required packages. 0 [OK]
i452/jboss-fuse-6.1.0.redhat-379 jboss-fuse-6.1.0.redhat-379 0
jolokia/redhat-msa-day “Docker for Java Developers” @ Red Hat MSA… 0
yjjy0921/redhat7.2 A clear redhat 7.2 image from official red… 0
apiemont/redhat9 RedHat 9 (x86) 0
startx/sv-apache Container providing apache http service on… 0 [OK]
startx/sv-memcache Container providing memcached in-memory KV… 0 [OK]
startx/sv-postgres Container used to provide postgresql trans… 0 [OK]
startx/sv-ooconv Container providing unoconv document engin… 0 [OK]
startx/sv-mariadb Container providing mariadb (mysql) transa… 0 [OK]
ceylon/base-redhat-ceylon Base RedHat image with a Ceylon user 0 [OK]
ceylon/base-redhat Base image consisting of CentOS, Java, Ant… 0 [OK]
ayoubayb/redhat-cockpit-docker Redhat cockpit docker 0 [OK]
limengyu1990/redhat-base redhat-base 0
qiankunli/redhat-base a very clean redhat v6.4 x86_64 and can be… 0
[root@localhost ~]# docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
Digest: sha256:c6674c44c6439673bf56536c1a15916639c47ea04c3d6296c5df938add67b54b
Status: Image is up to date for ubuntu:latest
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 42118e3df429 2 days ago 124.8 MB
hello-world latest c54a2cc56cbb 3 weeks ago 1.848 kB

[[root@localhost ~]# docker run -i -t ubuntu /bin/bash
Unable to find image ‘ubuntu:latest’ locally
latest: Pulling from library/ubuntu
43db9dbdcb30: Pull complete
2dc64e8f8d4f: Pull complete
670a583e1b50: Pull complete
183b0bfcd10e: Pull complete
Digest: sha256:c6674c44c6439673bf56536c1a15916639c47ea04c3d6296c5df938add67b54b
Status: Downloaded newer image for ubuntu:latest
root@1d1d01652517:/#

root@a7edcd1406cb:/# cat /etc/issue
Ubuntu 16.04 LTS \n \l

root@1d1d01652517:~# apt-get update

root@1d1d01652517:~# apt-get install lsb-release
root@f6958d6f5a92:/# apt-get install net-tools

root@f6958d6f5a92:/# ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:02
inet addr:172.17.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11223 errors:0 dropped:0 overruns:0 frame:0
TX packets:7582 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:25016252 (25.0 MB) TX bytes:507649 (507.6 KB)

root@1d1d01652517:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

root@1d1d01652517:~# exit

[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a7edcd1406cb ubuntu “/bin/bash” 10 minutes ago Exited (0) 8 minutes ago elated_hoover
[root@localhost ~]# docker pull hjd48/redhat
Using default tag: latest
latest: Pulling from hjd48/redhat
bd430652e611: Pull complete
6bdabd5bbf30: Pull complete
2190b8dd6f34: Pull complete
132e35f005fe: Pull complete
7e0814877e64: Pull complete
a3ed95caeb02: Pull complete
34149fdd12ad: Pull complete
0a052d220e98: Pull complete
97d9918d22d8: Pull complete
Digest: sha256:c1575a011be80170925817d1aa122dedc68791e31a074c3cc02f9e4461974627
Status: Downloaded newer image for hjd48/redhat:latest

[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 42118e3df429 2 days ago 124.8 MB
hello-world latest c54a2cc56cbb 3 weeks ago 1.848 kB
hjd48/redhat latest d7852422d6c5 22 months ago 414.2 MB
[root@localhost ~]# docker run -i -t hjd48/redhat /bin/bash

bash-4.1# cat /etc/system-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)

bash-4.1# hostname
0d9b9de33a64

bash-4.1# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
26: eth0@if27: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether 02:42:ac:11:00:04 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.4/16 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::42:acff:fe11:4/64 scope link
valid_lft forever preferred_lft forever
[root@localhost ~]# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0d9b9de33a64 hjd48/redhat “/bin/bash” About a minute ago Exited (0) 11 seconds ago elated_carson

[root@localhost ~]# w
12:08:07 up 1:34, 5 users, load average: 0.21, 0.20, 0.23
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root :0 :0 10:34 ?xdm? 2:25 0.26s gdm-session-worker [pam/gdm-password]
root pts/0 :0 10:34 44:08 0.07s 0.07s /bin/bash
root pts/1 192.168.122.1 10:34 1:36 0.93s 0.11s docker run -i -t ubuntu /bin/bash
root pts/3 192.168.122.1 12:08 3.00s 0.14s 0.09s w
root pts/5 192.168.122.1 12:04 2:24 0.13s 0.05s docker run -i -t hjd48/redhat /bin/bash
[root@localhost ~]# docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 2466 [OK]
jdeathe/centos-ssh CentOS-6 6.8 x86_64 / CentOS-7 7.2.1511 x8… 26 [OK]
nimmis/java-centos This is docker images of CentOS 7 with dif… 13 [OK]
million12/centos-supervisor Base CentOS-7 with supervisord launcher, h… 12 [OK]
consol/centos-xfce-vnc Centos container with “headless” VNC sessi… 10 [OK]
torusware/speedus-centos Always updated official CentOS docker imag… 8 [OK]
nickistre/centos-lamp LAMP on centos setup 4 [OK]
nathonfowlie/centos-jre Latest CentOS image with the JRE pre-insta… 3 [OK]
centos/mariadb55-centos7 3 [OK]
consol/sakuli-centos-xfce Sakuli end-2-end testing and monitoring co… 2 [OK]
timhughes/centos Centos with systemd installed and running 1 [OK]
blacklabelops/centos CentOS Base Image! Built and Updates Daily! 1 [OK]
darksheer/centos Base Centos Image — Updated hourly 1 [OK]
kz8s/centos Official CentOS plus epel-release 0 [OK]
grossws/centos CentOS 6 and 7 base images with gosu and l… 0 [OK]
harisekhon/centos-scala Scala + CentOS (OpenJDK tags 2.10-jre7 – 2… 0 [OK]
ericuni/centos centos dev 0 [OK]
grayzone/centos auto build for centos. 0 [OK]
repositoryjp/centos Docker Image for CentOS. 0 [OK]
januswel/centos yum update-ed CentOS image 0 [OK]
jsmigel/centos-epel Docker base image of CentOS w/ EPEL installed 0 [OK]
aguamala/centos CentOS base image 0 [OK]
ustclug/centos USTC centos 0 [OK]
dmglab/centos CentOS with some extras – This is for the … 0 [OK]
sgfinans/docker-centos CentOS with a running sshd and Docker 0 [OK]

[root@localhost ~]# docker pull centos
Using default tag: latest
latest: Pulling from library/centos
8c3d77a518cb: Pull complete
Digest: sha256:7b754086d2c7d74ac39dc0a2545d7b06d4266f873d502feb5b3e8bfca27c5dd8
Status: Downloaded newer image for centos:latest

[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 42118e3df429 2 days ago 124.8 MB
centos latest 50dae1ee8677 5 days ago 196.7 MB
hello-world latest c54a2cc56cbb 3 weeks ago 1.848 kB
hjd48/redhat latest d7852422d6c5 22 months ago 414.2 MB

[root@localhost ~]# docker run -it centos

[root@a1d3b08e2d96 /]# hostname
a1d3b08e2d96

[root@a1d3b08e2d96 /]# ip a
bash: ip: command not found

[root@a1d3b08e2d96 /]# yum install net-tools
Loaded plugins: fastestmirror, ovl
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): extras/7/x86_64/primary_db | 149 kB 00:00:01
(2/4): updates/7/x86_64/primary_db | 5.7 MB 00:00:02
(3/4): base/7/x86_64/primary_db | 5.3 MB 00:00:03
(4/4): base/7/x86_64/group_gz | 155 kB 00:00:23
Determining fastest mirrors
* base: mirror.fibergrid.in
* extras: mirror.fibergrid.in
* updates: mirror.fibergrid.in
Resolving Dependencies
–> Running transaction check
—> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================
Installing:
net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k

Transaction Summary
================================================================================================================================================
Install 1 Package

Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/net-tools-2.0-0.17.20131004git.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for net-tools-2.0-0.17.20131004git.el7.x86_64.rpm is not installed
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm | 304 kB 00:00:00
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 (@CentOS)
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 : net-tools-2.0-0.17.20131004git.el7.x86_64
Verifying : net-tools-2.0-0.17.20131004git.el7.x86_64
Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
Complete!
[root@a1d3b08e2d96 /]#

[root@a1d3b08e2d96 /]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.5 netmask 255.255.0.0 broadcast 0.0.0.0
inet6 fe80::42:acff:fe11:5 prefixlen 64 scopeid 0x20<link>
ether 02:42:ac:11:00:05 txqueuelen 0 (Ethernet)
RX packets 5911 bytes 12564083 (11.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4663 bytes 323446 (315.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@localhost ~]# w
12:19:58 up 1:46, 6 users, load average: 0.06, 0.27, 0.28
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root :0 :0 10:34 ?xdm? 2:49 0.28s gdm-session-worker [pam/gdm-password]
root pts/0 :0 10:34 55:58 0.07s 0.07s /bin/bash
root pts/1 192.168.122.1 10:34 13:26 0.93s 0.11s docker run -i -t ubuntu /bin/bash
root pts/3 192.168.122.1 12:08 1:10 0.21s 0.09s docker run -it centos
root pts/5 192.168.122.1 12:04 5:26 0.13s 0.05s docker run -i -t hjd48/redhat /bin/bash
root pts/8 192.168.122.1 12:19 2.00s 0.08s 0.05s w

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s