This talk is aimed at technical people who have heard of Docker but not used it yet.
Docker is the new way to package, distribute and run your application or microservice. It's the bees-knees. It's the best thing since sliced bread. It's the kings pajamas etc, etc. In this short but packed talk I'll explain what Docker actually is and how it works. I'll show you how much of the hype is real and give a practical demo or two to illustrate the power of Docker. Is Docker the panacea for all ills? This talk will help you make up your mind.
3. Ship a complicated software environment
that leaves no trace when finished…
Be total confident that if it works for me it will
work the same for you
https://localhost:9043/ibm/console/logon.jsp
docker run --name test -h test -v $(pwd)/PASSWORD:/tmp/PASSWORD
-p 9043:9043 -p 9443:9443 -d ibmcom/websphere-traditional:install
10. docker run -d –p 8080:80 presentation
docker run -d –p 8081:80 presentation
docker ps
11. quick check
• Images are the unit of delivery. You only share images
• Images are immutable
• Images are stored in local caches or shared via registries.
• DockerHub is a central point Think “github” for docker images
• Containers are the runtime units. They run on a single host
• Containers retain state until terminated
• Containers are the unit of scale.
• docker ps lists the running containers
• docker ps -a lists all containers
14. Docker images are layers in a union file system.
Each layer overlays the ones before:
presentation
eboraas/apache
eboraas/debian
eboraas/debootstrap
15. Dockerfile - automated image creation
FROM eboraas/apache
COPY ./DockerIn30Minutes /var/www/html
Where’s the command to run the apache server? I inherited it
16. FROM eboraas/debian:stable
MAINTAINER Ed Boraas <ed@boraas.ca>
RUN apt-get update && apt-get -y install apache2 && apt-get clean
&& rm -rf /var/lib/apt/lists/*
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
RUN /usr/sbin/a2ensite default-ssl
RUN /usr/sbin/a2enmod ssl
EXPOSE 80
EXPOSE 443
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
17. quick check
• Dockerfiles are the normal way to create docker images.
• Usually:
• has a name of image to inherit from
• has a set of build instructions to run at build time
• has some runtime instruction (ie what to start)
20. Volumes
• Think of containers as mini VM’s
• Any mutations made to the containers contents will be lost when the
container is stopped
• How to share or persist state?
• Two options..
21. docker run -d -v $PWD:/var/www/html p 8082:80 —t presentation
Think of as an nfs mount style command
mounts a local directory on the host over the top of a directory in the container
Both directory paths must be absolute
The container can read/write the contents of the host file system
-v
22. VOLUME command
VOLUME /data
Dockerfile command to create a persistent data store on the host system that is
accessed inside the container at the path given.
Volumes persist on the host until deleted.
Volumes are a great way to share state between containers
docker run -d —volumes-from container image
auto magically mount the volumes created by another container
25. Advanced section
• Docker for encapsulating a single instance of a complex environment is
useful
• Docker as the packing and deployment of an single micro service is
compelling
• Docker tools exist to network containers together and to scale and load
balance across multiple hosts and data centres.
• Containerisation is the enabler for industrial application deployments on
truly gigantic scales.
26. Docker compose
• “Compose is a tool for defining and running multi-container Docker
applications. With Compose, you use a Compose file to configure your
application’s services. Then, using a single command, you create and
start all the services from your configuration”
• https://docs.docker.com/compose/overview/