User Tools

Site Tools


Sidebar

software:virtualization:docker_rhel7

What?

Notes on basic docker setup/testing on RHEL7 or Centos.

commands

subscription-manager register --username=rhn-username \
  --password=password --name=chorn-rhel7-host --autosubscribe
subscription-manager repos --disable="*"
subscription-manager repos --enable=rhel-7-server-extras-rpms \
  --enable=rhel-7-server-rpms --enable=rhel-7-server-optional-rpms

yum install docker
systemctl enable docker.service
systemctl start docker.service
systemctl status docker.service

docker pull rhel7
docker images
docker run rhel7 echo "Hi there"
[root@rhel7u1a ~]# docker run -v /usr/sbin/:/usr/sbin/ \
  -i -t rhel7 /usr/sbin/ip addr show eth0
18: eth0: <NO-CARRIER,BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 02:42:ac:11:00:07 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.7/16 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:acff:fe11:7/64 scope link tentative 
       valid_lft forever preferred_lft forever
[root@rhel7u1a ~]# docker run -v /usr/sbin/:/usr/sbin/ \
  -v /usr/bin/:/usr/bin/ -v /usr/lib64/:/usr/lib64/ \
  -i -t rhel7 ps axf
  PID TTY      STAT   TIME COMMAND
    1 ?        Rs+    0:00 ps axf
    
### interactive
[root@rhel7u1a ~]# docker run -i -t --rm rhel7
[root@a081321f8f04 /]# ls
bin  boot  dev  etc  home  lib  lib64  media  [..]
[root@a081321f8f04 /]# exit
[root@rhel7u1a ~]# 

docker ps
docker inspect <image-name>
docker start <image-name>
docker stop <image-name>
docker kill <image-name>
docker rm <container>
docker rmi <image>
software/virtualization/docker_rhel7.txt ยท Last modified: 2021/03/23 12:22 (external edit)