Docker – Lab – Assignment – Narender Yalamadhi
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Step 3 – Install Docker Engine in Centos#1 Vm.
Install Docker
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install –y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y docker-ce
docker -v
sudo systemctl enable docker
sudo systemctl start docker
docker info
which docker
which dockerd
ps -eaf | grep dockerd
which containerd
ps -eaf | grep containerd
history
[root@localhost ~]#
Step 4 – Assignment#1
- Create a Ubuntu container
- Install Update, git & apache2
- run a git command in container from outside
docker run -itd ubuntu
docker ps -a
docker exec -it 4d5fce1241d5 /bin/bash
docker run -d httpd
docker ps -a
apt-get -y install git
apt-get -y install apache2
apt-get -y update git
git --version
Step 5 – Assignment#2
- Create a httpd container exposed at 8080 port
- Access(curl) container from node
docker run -d -p 80:80 httpd
wget localhost:80