Docker concept – part 4 Install demo docker and test
[user@debasiseric1 ~]$ sudo su –
[sudo] password for user:
Last login: Mon Apr 9 12:20:36 UTC 2018 on pts/0
[root@debasiseric1 ~]# cd /etc/docker
[root@debasiseric1 docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 6 70b5d81549ec 3 days ago 195MB
We need to pull the httpd demo docker image
[root@debasiseric1 docker]# docker image pull httpd
Using default tag: latest
latest: Pulling from library/httpd
f2b6b4884fc8: Pull complete
b58fe2a5c9f1: Pull complete
e797fea70c45: Pull complete
6c7b4723e810: Pull complete
02074013c987: Pull complete
4ad329af1f9e: Pull complete
0cc56b739fe0: Pull complete
Digest: sha256:b54c05d62f0af6759c0a9b53a9f124ea2ca7a631dd7b5730bca96a2245a34f9d
Status: Downloaded newer image for httpd:latest
Now you can check demo docker image httpd
[root@debasiseric1 docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 6 70b5d81549ec 3 days ago 195MB
httpd latest 805130e51ae9 2 weeks ago 178MB
[root@debasiseric1 docker]# docker container run -d –name testweb httpd
2d1d3bf7ad9479c5c21662d63f557849a15fa4b23c7dfd03a9a78afe647e3983
Please check IP address associated to this demo docker
[root@debasiseric1 docker]# docker container inspect testweb | grep IPAddr
“SecondaryIPAddresses”: null,
“IPAddress”: “172.17.0.2”,
“IPAddress”: “172.17.0.2”,
Please check what httpd processes are running
[root@debasiseric1 docker]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2d1d3bf7ad94 httpd “httpd-foreground” 29 seconds ago Up 26 seconds 80/tcp testweb
[root@debasiseric1 docker]# sudo yum install -y telnet elinks
Please check whether your are able to connect to HTTP request using elinks
[root@debasiseric1 docker]# elinks http://172.17.0.2