Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hunting Moby Dick: An introduction to Docker at LIPN

Hunting Moby Dick: An introduction to Docker at LIPN

Jaime Arias Almeida

February 22, 2019

More Decks by Jaime Arias Almeida

Other Decks in Programming


  1. Why Docker ◎ “Dockerized” apps are completely portable and can

    run anywhere. ◎ Developers can automate their build pipeline and share artifacts with Docker Hub. ◎ “Dockerized” apps are isolated from their surroundings. “W ” - ” “I f USB ” - ” “T f O 4. I 4. ” - ” 3
  2. Ubuntu Installation Link: https://tinyurl.com/docker-ubuntu 1. Update the apt package index

    2. Install packages to allow apt to use a repository over HTTPS 10
  3. Ubuntu Installation Link: https://tinyurl.com/docker-ubuntu 3. Add Docker’s official GPG key:

    4. Use the following command to set up the stable repository. 11
  4. Ubuntu Installation Link: https://tinyurl.com/docker-ubuntu 1. Update the apt package index

    2. Install the latest version of Docker CE 3. Add your user to the docker group 12
  5. Resources 14 1. awesome-docker: https://github.com/veggiemonk/awesome-docker 2. GUIs: ◉ Kitematic: https://github.com/docker/kitematic

    ◉ Portainer: http://portainer.io ◉ DockStation: https://dockstation.io ◉ Dockly: https://github.com/lirantal/dockly
  6. Basic Commands docker COMMAND --help Print COMMAND usage. docker pull

    NAME[:TAG] Pull an image or a repository from Docker Hub to the machine. docker images Show all top level images, their repository and tags, and their size. docker rmi IMAGE Remove one or more images. 16
  7. Basic Commands docker run --rm [OPTIONS] IMAGE [COMMAND] [ARGS] Run

    a COMMAND with specific ARGS in a new container. OPTIONS ◎ --detach, -d Run container in background and print container ID ◎ --env, -e Set environment variables ◎ --interactive, -i Keep STDIN open ◎ --name Assign a name to the container ◎ --publish, -p Publish a container’s port(s) to the host ◎ --rm Automatically remove the container when it exits ◎ --tty, -t Allocate a pseudo-TTY ◎ --volume, -v Bind mount a volume 20
  8. Basic Commands docker exec CONTAINER Run a command in a

    running container. docker ps -a List the running containers. docker stop CONTAINER Stop one or more running containers. docker rm -f CONTAINER Remove one or more containers 25
  9. Build & Publish Build 1. Create a Dockerfile (recipe) 2.

    Build an image from the Dockerfile in the current directory and tag it Publish 1. Retag a local image for a private registry 2. Log in to a registry (https://hub.docker.com) 3. Push an image to the registry (upload) 29
  10. Basic Commands docker build -t NAME[:TAG] PATH Build an image

    from a Dockerfile. docker login [SERVER] Log in to a Docker registry docker push NAME[:TAG] Push an image or a repository to a registry docker tag SOURCE TARGET Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE 30
  11. Credits Special thanks to all the people who made and

    released these awesome resources for free: ◎ Presentation template by SlidesCarnival ◎ Photographs by Unsplash 33