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

Hunting Moby Dick: An Introduction to Docker

Hunting Moby Dick: An Introduction to Docker

Jaime Arias Almeida

December 13, 2017
Tweet

More Decks by Jaime Arias Almeida

Other Decks in Technology

Transcript

  1. Hunting Moby Dick: An
    Introduction to Docker
    Jaime Arias
    December 2017

    View Slide

  2. Introduction
    Why Docker ?
    1
    2

    View Slide

  3. 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 ” - M
    “I f USB ” - M
    “T f R 3.Y I R 3.X” - M
    3

    View Slide

  4. Why Docker
    4

    View Slide

  5. Installation
    https://www.docker.com
    2
    5

    View Slide

  6. Download & Installation
    N 6

    View Slide

  7. OSX Installation
    7

    View Slide

  8. OSX Installation
    8

    View Slide

  9. OSX Configuration
    9

    View Slide

  10. 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

    View Slide

  11. 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

    View Slide

  12. 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

    View Slide

  13. Testing Installation
    13

    View Slide

  14. Basic Commands
    https://tinyurl.com/docker-commands
    3
    14

    View Slide

  15. 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.
    15

    View Slide

  16. Basic Example
    16

    View Slide

  17. 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
    17

    View Slide

  18. Basic Example
    18

    View Slide

  19. Basic Example
    19

    View Slide

  20. Data: https://tinyurl.com/pyhrf-test
    Basic Example
    20

    View Slide

  21. Basic Example
    21

    View Slide

  22. Basic Example
    Viewer: https://tinyurl.com/mango-viewer
    22

    View Slide

  23. 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
    23

    View Slide

  24. Basic Example
    Instructions: https://tinyurl.com/docker-rstudio
    24

    View Slide

  25. Basic Example
    25

    View Slide

  26. Create a Docker Image
    https://tinyurl.com/dockerfile-ref
    4
    26

    View Slide

  27. Dockerfile
    File: http://tinyurl.com/frama-docker
    27

    View Slide

  28. 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 (Docker Hub)
    3. Push an image to the registry (upload)
    28

    View Slide

  29. 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
    29

    View Slide

  30. Basic Example
    30

    View Slide

  31. Docker & Mistis’ Cluster
    5
    Avoiding Jean-François ...
    31

    View Slide

  32. Basic Commands
    docker save -o PATH IMAGE
    Save one or more images to a tar archive
    docker load -i PATH
    Load an image from a tar archive.
    32

    View Slide

  33. Basic Example
    L M
    C M
    33

    View Slide

  34. Thanks!
    Any questions?
    34

    View Slide

  35. Credits
    Special thanks to all the people
    who made and released these
    awesome resources for free:
    ◎ Presentation template by
    SlidesCarnival
    ◎ Photographs by Unsplash
    35

    View Slide