Skip to content

Latest commit

 

History

History
106 lines (74 loc) · 2.5 KB

File metadata and controls

106 lines (74 loc) · 2.5 KB

Docker

  • For Ubuntu, want to install docker-ce ("Community edition") rather than docker.io (a now-out-of-date version)

    The instructions are here.

    Ended up doing:

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
    sudo apt-get install docker-ce docker-ce-cli containerd.io
    
  • To install docker for minecraft, I changed to the directory containing the Dockerfile in the miner package installation, and then followed the instructions in the miner book.

    cd ~/Rlibs/miner/Dockerfile .
    sudo docker build -t minecraft .
    
  • To view the IP address of a docker container, type:

    ip addr show
    

    Look for lines following "docker"

  • My slides about docker:

  • For r-devel with R/qtl, create a Dockerfile with:

    FROM rocker/r-devel
    RUN RD -e "install.packages('qtl')"
    

    and then do sudo docker build -t rdevel-qtl .

    That will create the image you want. Then run a container and open bash using:

    sudo docker run -it rdevel-qtl bash

    To install a package from github, use the remotes package.

    Also note: with rocker/r-devel, you start R using RD.

  • To use R-devel with the clang compiler and UBsan (undefined behavior checker), use FROM rocker/r-devel-ubsan-clang. You again need to use RD within the container to run R, and also need docker run --cap-add SYS_PTRACE.

    So once you've created the container (with say sudo docker build -t rdevel-clang-ubsan .), you run it with:

    sudo docker run --cap-add SYS_PTRACE -it rdevel-clang-ubsan bash
  • View images

    sudo docker images
    sudo docker image ls
    
  • View running containers

    sudo docker container ls -a
    
  • Start a container in interactive mode

    sudo docker start -i [container_name]
    
  • Run a container from an image, interactively in a bash shell

    sudo docker run -it [image_name] bash
    
  • Remove a running container

    sudo docker rm [container_name]
    
  • Remove an image

    sudo docker image rm [repository or image id]