Intro to Docker Intro to Docker Container technology so easy it should be illegal not to use it. Linux User Group of Davis (LUGOD) 05/16/2016 0 reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i... 1 of 45 6/11/16, 7:16 PM
45
Embed
reveal.js - The HTML Presentation Framework · 2016-06-12 · Docker, tutorial 0
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Intro to DockerIntro to DockerContainer technology so easy it should be
illegal not to use it.Linux User Group of Davis (LUGOD)
05/16/2016
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
1 of 45 6/11/16, 7:16 PM
OutlineOutlineSlides available at Why Docker?What is Docker?Basic docker terminologies and commandsHands-on exercise:
build a Docker imagerun Docker container to update theHackerWithinDavis chapter website
http://goo.gl/cj70Fw
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
2 of 45 6/11/16, 7:16 PM
Why Docker?Why Docker?
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
3 of 45 6/11/16, 7:16 PM
Why Docker?Why Docker?Helps reproduce an exact software environmentGood for:
software development / deploymentreproducible science!teaching (and grading)
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
4 of 45 6/11/16, 7:16 PM
What is Docker?What is Docker?An open-source technology thatallows you to package an appwith all its dependencies into astandardized unit for software
development.
-Docker website
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
5 of 45 6/11/16, 7:16 PM
What is Docker?What is Docker?One container for running approximately one app
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
28 of 45 6/11/16, 7:16 PM
Ex2: Running the Jekyll webEx2: Running the Jekyll webblogblog
$ git clone \https://github.com/thehackerwithin/davis$ cd davis
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
29 of 45 6/11/16, 7:16 PM
Running the Jekyll web blogRunning the Jekyll web blog$ docker run -it \-p 4000:4000 \ -v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/root \karenyng/hackerwithin_dockerfile \ruby -S jekyll serve \--host=0.0.0.0 --watch --force_polling
Now it is up and running!
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
30 of 45 6/11/16, 7:16 PM
Check the IP address of yourCheck the IP address of yourDocker machineDocker machine
$ docker-machine ip 127.0.0.1 # for Linux192.168.99.100 # for Mac and Windows
Now point your browser to DOCKER_IP:4000
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
31 of 45 6/11/16, 7:16 PM
What did we just do?What did we just do?$ docker run -it \-p 4000:4000 \ -v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/root \karenyng/hackerwithin_dockerfile \ruby -S jekyll serve \--host=0.0.0.0 --watch --force_polling
docker run runs a certain image, in this casekarenyng/hackerwithin_dockerfile which wehave pulled previously
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
32 of 45 6/11/16, 7:16 PM
What did we just do?What did we just do?$ docker run -it \-p 4000:4000 \ -v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/root \karenyng/hackerwithin_dockerfile \ruby -S jekyll serve \--host=0.0.0.0 --watch --force_polling
-i means run iteractively, asking the container to readfrom the host's STDIN-t asks container to bind to a pseudo-terminal
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
33 of 45 6/11/16, 7:16 PM
What did we just do?What did we just do?$ docker run -it \-p 4000:4000 \ -v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/root \karenyng/hackerwithin_dockerfile \ruby -S jekyll serve \--host=0.0.0.0 --watch --force_polling
-p HOST_PORT:CONTAINER_PORT exposes the port
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
34 of 45 6/11/16, 7:16 PM
What did we just do?What did we just do?$ docker run -it \-p 4000:4000 \ -v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/root \karenyng/hackerwithin_dockerfile \ruby -S jekyll serve \--host=0.0.0.0 --watch --force_polling
-v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/roottells Docker to mount the directory of theHackerwithin Davis repo to /root in the
container
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
35 of 45 6/11/16, 7:16 PM
What did we just do?What did we just do?$ docker run -it \-p 4000:4000 \ -v $PATH_TO_HACKERWITHIN_DAVIS_DIR:/root \karenyng/hackerwithin_dockerfile \ruby -S jekyll serve \--host=0.0.0.0 --watch --force_polling
Last two lines tell Jekyll to keep onmonitoring for changes.
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
36 of 45 6/11/16, 7:16 PM
Clearing up spaceClearing up space$ docker stop CONTAINER_ID $ docker ps -a # checks local containers $ docker rm CONTAINER_ID # removes container $ docker images # checks local images$ docker rmi IMAGE_NAME # removes image
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
37 of 45 6/11/16, 7:16 PM
What is next? Use Docker forWhat is next? Use Docker for......
running SaaS for a startuprunning a continuous integration servicerunning R Studio ( ) or webclient for remote machines
NERSC HPC version Jupyter
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
38 of 45 6/11/16, 7:16 PM
Learning resourcesLearning resources
San Francisco
How to use from Docker
Docker tutorialDocker online webminars
Docker meetupsDocker best practises
Jekyll
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
39 of 45 6/11/16, 7:16 PM
Thanks for listening!Thanks for listening!
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
40 of 45 6/11/16, 7:16 PM
Linux resourcesLinux resources for running Docker on Linux without
sudo privileges.Guide
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
41 of 45 6/11/16, 7:16 PM
Hands-on exercises for thoseHands-on exercises for thosewho want to run docker im-who want to run docker im-
agesagesdifficulty: easy
run and modify the HackerWithinrun run Jupyter for Spark/ SparkR/PySpark / Scipy Jupyter notebook in Dockerrun
pagerOpenSci R studio web client
Docker-stack
Tensorflow
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
42 of 45 6/11/16, 7:16 PM
Building Dockerfiles / usingBuilding Dockerfiles / usingDocker on the CloudDocker on the Cloud
difficulty: more involvedwrite your own Dockerfile and build your own appuse Docker compose to run the Docker 3rdbirthday web app setup the HortonWorks Data Platformfor playing with Hadoop and Spark in Dockerchallenge: write the Dockerfile(s) for Astrophysicscodes, e.g.
,
tutorialsandbox
CosmosisAstrometry.net
0
reveal.js - The HTML Presentation Framework http://127.0.0.1:8000/dockerTutorial_LUGOD.html?print-pdf#/i...
43 of 45 6/11/16, 7:16 PM
Incomplete collection of use-Incomplete collection of use-ful commandsful commands