Josh Finnie PRO
Full stack staff engineer. Lives in the DMV.
Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers.
~ Docker, Inc.
Docker is a set of tools that allow for you to "containerize" your code into isolated images for fun and for profit.
~ Josh Finnie
Moving to containers for your code gives you a lot of benefits:
https://www.zdnet.com/article/docker-is-in-deep-trouble/
Steps to success:
Take this with a bit of a grain of salt, as I have only been working at PBS for about 3 weeks at this point.
Almost everything I do is in Docker!
$ docker run -it python-2.7 python
Python 2.7.16 (default, Sep 12 2019, 17:36:22)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 5 / 2 == 2.5
False
>>> # (╯°□°)╯︵ ┻━┻
$ docker run -it python-3.8 python
Python 3.8.0b4 (default, Sep 12 2019, 15:28:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> # LET'S FIX WHAT WAS BROKEN IN 2.7
>>> 5/2 == 2.5
True
>>> # ┬─┬ノ( º _ ºノ)
...
>>> # LET'S USE THE WALRUS OPERATOR!!
...
>>> a = 11
>>> if (b := a) > 10:
... print(f"The value of b is {b} and is greater than 10.")
...
The value of b is 11 and is greater than 10.
$ docker images | grep python
python-2.7 latest ab1097281d06 2 weeks ago 433MB
python-3.8 latest 58fdeab98f5c 2 weeks ago 521MB
python-3.6 latest f72f51d6879f 2 weeks ago 503MB
$ docker images | grep nvm
nvm-10.16.3 latest 7a9afc16a57f 2 weeks ago 394MB
nvm-stable latest 8fc2110c6978 7 months ago 397MB
# Running using MacTeX
$ /Library/TeX/Distributions/TeXLive-2019.texdist/Contents/Programs/texbin/pdflatex sample.tex
# Running using Docker
$ docker run -v `pwd`:/tmp latex pdflatex sample.tex
Not only do I not have to worry about trying to install Latex on my mac, I can just save the installation and all my little optimizations and save it as a Docker image!
FROM debian:buster-slim
RUN apt-get update && \
apt-get install --no-install-recommends -y \
biber=2.12-2 \
latexmk=1:4.61-0.1 \
texlive-full=2018.20190227-2 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
https://www.joshfinnie.com
By Josh Finnie
A presentation on the use of Docker and how it made micro-service architecture a thing.