Uploaded by rajes9853

Docker Note plus Assignment

advertisement
Docker --> Is helping us to create 100
Laptops/Dessktops with 1 single laptop
Docker layers - Exceuting each command
in a specific order which is given in the
dockerfile
Layer 1
Laye2
Layer 3
Flow of docker
Dockerfile -> Docker Image ---> Docker
Container ->> We can create a
machine/vm
Virtual machines (Laptop) --> Coding /
Deploy software / Deploy your application
/ Management of the systems [ Linux ]
DOCKER BUILD ----> It will convert a
dockerfile into an image
DOCKER RUN --> Is to create the
container from an Image
DOCKER PULL [IMAGE ]--> central hub
image pull to local laptop
DOCKER PUSH [IMAGE ]--> local repo to
central repo push
DOCKER CREATE -> Components of
Docker
DOCKER START [ CONTAINER ] ---> It is to
start the container
DOCKER EXEC [ CONTAINER ]--> To go
inside a container and do a debugging
FROM
ENV HTTP 10.112.34.45
RUN apt-get install httpd && cd ~/conf/
&& cat httpd.conf | grep -ix ip -- $HTTP
NAGARRO / AIRTEL / AMAZON ….
docker run Dockerfile --parameter1 abc -paranmeter2 xyz [ COMMAND LINE
INTERFACFACE ]
Dockerfile -->
CMD ["echo", ${parameter1}] --> abc
ENTRYPOINT [ "echo", java -jar hell.jar -abc ]
EXITED STATE WHY???
1. CPU AND MEMORY ARE LESS
2. APPLICATION NOT RUNNING [
DOCKER EXEC ]
3. ACCESS ISSUES [ USER ]
4. WRONG DOCKERFILE
5.
image pull back off [ WHEN DOCKER
IMAGE IS NOT AVAILABLE ]
Every container created in docker host will run
defaultly on docker BRIDGE network
STEP1 -CLONE THIS
https://github.com/praveen1994dec/kubernetes_Jenkins_deployment
STEP2 - Launch your jenkins container
2.1 -> You can use my image --->docker pull
praveensingam1994/jenkins-sonar:latest
2.2 -> https://github.com/praveen1994dec/Docker_Setup/blob/main/docker-compose.yml [
docker-compose up -d ]
STEP 3 - Launch Your SONARQUBE
https://medium.com/@HoussemDellai/setup-sonarqube-in-a-docker-container-3c3908b624df
STEP 4 - localhost:8083 [ Open jenkins ]
STEP 5 - Go to Manage jenkins -> Add a plugin -->
DOCKER PIPELINE
STEP 6 - GO TO GLOBAL TOOL CONFIG -> ADD
DOCKER
STEP 7 - REPEAT STEP 5 FOR SONAR --> ADD A
PLUGIN NAME SONAR .*
STEP 8 -> Launch SONAR at port 9000 and ADD
SONAR QUBE SCANNER IN JENKINS
STEP 9 -> CREATE A JENKINS JOB AND ADD THE
REPO AND ADD THE BUILD STEP AS "Execute
SonarQube Scanner"
STEP 10 -> Add the properties file
sonar.projectKey=SINGAMKEY
sonar.login=admin
sonar.password=
sonar.sources=/var/jenkins_home/workspace/Sonar_Project/productcatalogue
sonar.hosturl=http://192.168.0.105:8084 [ REPLACE WITH YOUR HOST IP AND PORT ]
************
#sonar.exclusions=stockmanager/**,productcatalogue/**,shopfront/**,**/*.java
sonar.exclusions=vendor/**,storage/**,resources/**,**/*.java
WEDNESDAY 8 PM- 9 PM [ DOUBTS CLEARING
SESSION ]
**** IF AND ONLY IF MORE THAN 100 PEOPLE
ARE THERE :)
Download