0% found this document useful (0 votes)
34 views3 pages

Docker Telugu Star Part7

Uploaded by

Praneeth Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

Docker Telugu Star Part7

Uploaded by

Praneeth Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

If you want to copy some files from a source folder to docker then you can use COPY or ADD.

But what if if you want to


ignore some files and copy only a few…then we have create a file by the name vi .Dockerignore and in this file give the
fine names that you want to ignore.Pls give the full path of the files that you want to ignore . This .Dockerignore file
should be in the same folder where we have Dockerfile.

We never run any docker commands manually in the realtime…we always configure Jenkins to do them. Jenkins will
compile the code and then run the test cases and then package the code and then it will call the docker.

VOLUMES : For ex you want to monitor the logs which the conainers are generating..for this if you install elasticsearch
or any other agent on the containers is not a good idea as the containers should be as much light weight as
possible..so what we do is…we some how get the logs which is present inside the container on to your host
system ..and on our parent system we will install agent and this agent will push the logs to wherever you want…ie it
can be alogserver or logstash etc .For this we will be working with what is called ad DOCKER VOLUME.By using docker
volume even if the container fails we will not lose the logs.

We never knew that we are working on the volumes …but we are already working on the volumes with out our
knowledge. For every container we run there will be a volume created.To see all the list of volumes : docker volume ls

Let us see what are the things we can do with the volumes
docker volume inspect <volume-id>

by inspecting the volume we can see where is the path of the volume.In the above pic you can see the docker volume
path: /var/lib/docker/volumes/<volume-id>

if you open the above with sudo ..then you can see the data in the volume.EVEN IF THE CONTAINER IS DELETED THE
VOLUMES ARE STILL PRESENT..THIS IS A BIG ADVANTAGE OF THE CONTAINER. TO PROVE THIS POINT LETS US DELETE
ALL THE CONTAINERS PRESENT IN OUR SYSTEM AND TRY TO OPEN THE ABOVE PATH .WE WILL SEE THE BELOW
SCREEN

WE HAVE DELETED THE JENKINS CONTAINER BUT THE VOLUME IS STILL PRESENT AND THE DATA IS STILL AVAIALBLE .

VOLUMES ARE NOTHING BUT SOME MOUNTPOINT ON YOUR CONTAINERS.BUT WHAT IS A MOUNTPOINT IN LINUX..?
MOUNTPOINT IS SOME AREA ON YOUR SYSTEM.IN YOUR COMPANY YOU MAY SEE T DRIVE , Z DRIVE, X DRIVE .THESE
ARE ALL MOUNTS.

You might also like