Docker

Table of contents

Child pages

Related pages

  • ...

Intros

  • ROpenSciLabs.github.io - What is Docker and Why should I use it?
    • This first page of the tutorial was a good quick overview of what Docker is for:
    • In short, you should use Docker because

      • it allows you to wrangle dependencies starting from the operating system up to details such as R and Latex package versions
      • it makes sure that your analyses are reproducible.

      There are a couple of other points what Docker helps with:

      • Portability: Since a Docker container can easily be sent to another machine, you can set up everything on your own computer and then run the analyses on e.g. a more powerful machine.
      • Sharability: You can send the Docker container to anyone (who knows how to work with Docker).

      Basic vocabulary

      The words image and container will come up a lot in the following. An instance of an image is called container. An image is the setup of the virtual computer. If you run this image, you will have an instance of it, which we call containter. You can have many running containers of the same image.

  • Docker - Get Started
    • The difference between a container and a virtual machine:
      • container runs natively on Linux and shares the kernel of the host machine with other containers. It runs a discrete process, taking no more memory than any other executable, making it lightweight.

        By contrast, a virtual machine (VM) runs a full-blown “guest” operating system with virtual access to host resources through a hypervisor. In general, VMs provide an environment with more resources than most applications need.

Important commands

  • docker container ls

  • docker <container_id> exec <command>

  • docker build -t <desired image name> .

  • docker run <image name>

  • docker-machine restart

Python

Troubleshooting / debugging