Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 40

Docker training

Part 2 – Docker fundamentals


https://training.docker.com/self-
paced-training
1)

2)

1) Use the current folder as path by using “.”


2) Use the “myproject” folder as path
The CMD executes when “docker run” is triggered. I.e. you can not use it as a way to
modify items in the build.

CMD can be overridden by e.g. a $docker run IMAGE “another command” command
ENTRYPOINT can not be overriden, executes when the container is run
($docker run image). Can take arguments

Could probably be used for retrieving config parameters for the container (e.g. zookeeper
or similar)
If you run a container in detached mode (-d option) you need to know the container ID in
order to stop it using the “docker stop <container ID>” command. It will also work with
container name.
If parts that you used to build your image already is existing in docker hub (e.g.
ubuntu:14.04 then it will skip pushing that part and only reference it to)
Possible usage, multiple containers can have a common log volume

Apa Katt Hund

Apa-folder
Central Log
Katt-folder
analyzer
Hund-folder
Using ”-p” you are telling what port on the host where docker runs that are mapped to the
container port. So in example above <myip>:8080 → <container>:80
”db” is an alias.

You might also like