Docker – Lab – Assignment – Bhargav

DevOps

MOTOSHARE πŸš—πŸοΈ
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
πŸš€ Everyone wins.

Start Your Journey with Motoshare

Step 1 – Register a site to POST Assigment and Share with Trainer and For Self Notes

- How to register? - https://www.bestdevops.com/wp-login.php?action=register
# Check Inbox SPAM box for Activation Email.
- How to login? - https://www.bestdevops.com/wp-login.php
- How to write post? - https://www.bestdevops.com/wp-admin/post-new.php
- How to check your Post? - https://www.bestdevops.comCode language: PHP (php)

Registered, Login successful, Posted

Step 2 – Pre Test using LMS

  • Login to https://www.devopsschool.com/lms/ using any gmail account
  • Try this quiz – https://www.devopsschool.com/lms/mod/quiz/view.php?id=250
  • Send a results to shiva@palmeto.co.in

Pretest completed, shared the results to Palmeto team

Step 3 – Install Docker Engine in Centos#1 Vm.

Step 1 - Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.
$ sudo -s
$ 
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Step 2 - Use the following command to set up the stable repository
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Step 3 - Install the latest version of Docker CE
$ sudo yum install –y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
$ sudo yum install -y docker-ce
$ sudo yum install docker-ce
# Verify Docker Installations
$ docker -v
# Docker is installed but not started. The docker group is created, but no users are added to the group.
Step 4 - Enable Docker
$ sudo systemctl enable docker
Step 5 - Start Docker
$ sudo systemctl start docker
$ docker info
Step 5 - Verify that docker is installed correctly by running the hello-world image.
$ sudo docker run hello-worldCode language: JavaScript (javascript)

https://devopsschool.com/tutorial/docker/install-config/docker-install-commuityedition-centos-rhel.html

Step 4 – Assignment#1

  • Create a Ubuntu container
  • Install Update, git & apache2
  • run a git command in container from outside
docker run -it ubuntu
apt -get update
apt-get -y install git
docker start 103a3cfda6cb
docker exec 103a3cfda6cb git --version
docker exec 103a3cfda6cb git --version
#git version 2.25.1Code language: CSS (css)

Step 5 – Assignment#2

  • Create a httpd container exposed at 8080 port
  • Access(curl) container from node
docker run -d -p 8080:80 httpd
docker ps -a
curl http://52.66.237.175:8080
It works
Code language: JavaScript (javascript)

Step 6 – Assignment#3

Find out answer for following questions
- Where is the LOCAL Registry and How do i find out???
  /var/lib/docker
- [OFFLINE]Git is NOT versioning a file. So what?
- What is diff between docker pause and docker unpuase?
- What is significant of docker stop and docker kill?
- Create an image with base - centos and git must be installed in it.Code language: JavaScript (javascript)

Step – Assignment#4 to create a Docker Image and share the image

created image, build it and shares at Docker hub

https://hub.docker.com/repository/docker/indukuribhargav/dockerfile

Step 7 – SHARE ASSIGNMENT WITH TRAINER

  • Create a POST and Send a URL of post in Zoom Chat.
  • Of Assignment#1 – Assignment#2 – Assignment#3 in one post
  • Post title can be of your choise