Assignment for docker day 1
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Q1. Explain What is Docker Container with image? Docker container is an independent application that is light weight . And which will be having 1 Root FS, 1 MNT NS , 1Networks NS , and 1 PID NS .Docker images are files that can be loaded into the container. The docker image which can be loaded into a container only if the Root File System of docker container is compatible with the image. Q2. What is the difference between docker stop and docker kill? Docker stop and kill command both stops a particular container in a safe and unsafe manner respectively Q3. What is the difference between docker pause and docker unpause? Docker pause is used to suspend a docker container . and Unpause is used to return back to the active state
docker images
docker create --name aswathi httpd
docker ps -a
docker start aswathi
docker ps
docker pause aswathi
docker ps
docker unpause aswathi
docker images
docker stop aswathi
docker ps -a
docker restart aswathi
docker ps -a
docker start aswathi
docker ps -a | grep aswathi
docker kill aswathi
docker restart asd
docker ps -a
docker create --name testasd httpd
docker start testasd
docker ps -a
docker kill aswathi
docker ps -a
docker kill asd
docker kill testasd
docker ps -a
docker restart testasd
docker ps -a
docker rm testasd
docker kill testasd
docker rm testasd
docker ps -a
Q1. – What is the use of “docker update” commands? with example and image
Docker update command used to change configurations of a particular container. Which helps to effectively utilize the resources by the containers.
docker update –kernel-memory 80M asdtest
docker update –cpu-shares 1024 asdtest
docker update –cpu-shares 1024 -m 300M asdtest
Q2. – What is the use of “docker wait” commands? with example and image
Docker wait command waits until the particular docker container stops
docker wait asdtest
docker stop asdtest
docker wait asdtest
Q3. – List of Top 5 docker images from hub.docker.com and create a running container of it and try to use it.
1.
docker pull python
docker create --name pythontest python
docker start pythontest
docker ps -a
docker exec -it pythontest python3
docker exec -it pythontest /bin/bash
2.
docker run -d --name aswathi_rb rabbitmq
docker ps -a
docker ps -a | grep aswathi_rb
3.
docker run --name aswathi_java --publish 8080:8080 java-docker
docker run -d --name asd_java -p 8080:8080 java-docker
docker ps -a | grep asd_java
4.
docker container run -d -p 8028:8080 -v jenkinsvol1:/var/tmp/testJenkins--name aswathi1 jenkins/jenkins:lts