on the Road
@ladislavGazo
watch out!
Tell me... what is it?
Containers
[ kontanje:re ]
Resource isolated space
No Overhead
no emulation
no guest OS
almost
Linux Needed
LXC, cgroups, namespaces, etc...
we've heard Windows is coming :)
What if...
I want to test-drive
Scala stack?
Closure stack?
12 OpenSSHs on one machine?
4 balanced nginxes?
I want to test-drive
Scala stack?
Closure stack?
12 OpenSSHs on one machine?
4 balanced nginxes?
What if...
... one can use ...
RAM, CPU, ...
RAM, CPU, ...
9 equal nginxes already there ;)
docker run --rm -ti nginx
docker ps
docker ps -a
Dockerfile
Recipe to build image
wooohooo it's a shell
FROM dockerfile/java:oracle-java7
RUN useradd -m -s /bin/bash developer
RUN apt-get update && apt-get install -y mc
RUN apt-get install git-flow
ADD .alias /home/developer/
RUN export uid=1000 gid=1000 && \
mkdir -p /home/developer/opt && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd
USER developer
ENV HOME /home/developer
CMD ["sudo", "/home/developer/entrypoint.sh"]
docker build --rm -t seges/mug-backend-java:oracle-7
docker images
docker images | grep nginx
Data
Service
Cron
nginx
spring boot
postgresql
80
One container
runit
Everything is container
nginx
spring boot
postgresql
80
spring boot
spring boot
postgresql
Scale
nginx
spring boot
app data
--volume-from
--link
--volume
/opt/docker/app/data
80
--publish
Container is everything
nginx
spring boot
app data
--volume-from
--link
--volume
/opt/docker/app/data
80
--publish
app config
Dockerize your dev environment
tools as containers
Mug Developer's toolkit
$ git clone mypowerproject
$ cd mypowerproject-server
$ mug
34@89530> mvn clean install
$ cd mypowerproject-client
$ mug
9687d932> gulp build
docker run -ti --rm \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ firefox
Fleet
What is still open
- how to orchestrate multiple hosts
- software defined networks
- proper service discovery
- transparent in apps
- mass deployment
- and others...
Alternatives
Cutlery
Ambassador
Bash
Consul
Registrator
DNS
Good practice is good practice
Use volumes
keep in mind scalability
host persistent vs. not
Images from the Hub
don't use them blindly
check Dockerfile
Root?
do you use it on your host?
so try not to in the container
Size matters
use layers wisely
inherit images
Container environment
e.g. locale setup
often UTF-8 is forgotten
Security
drop privileges as soon as possible
although isolated, security rules still apply
Ports
Bound to the host
think twice because of scalability and discovery
Orchestration tool
fig.sh
or nice & formatted Bash scripts
ICC
networking between containers
icc=false
DevOps tool
but helps on app level as well
e.g. in creating /separating microservices
Everything is a container ;)
golden rule
Thank you...
@ladislavGazo
gazo@seges.sk
need a workshop? consulting? contact me...
Docker on the Road!
By lgazo
Docker on the Road!
- 1,352