Last updated: 2019-01-28
Checks: 2 0
This reproducible R Markdown analysis was created with workflowr (version 1.1.1.9001). The Report tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view them.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 86f5c3d | John Blischak | 2019-01-28 | Add notes on using Docker. |
Docker is virtualization software. The official documentation is at docs.docker.com.
Terminology:
Getting help:
docker --help
docker <subcommand> --help
The name of an image is referred to as a repository. If the repository is from a remote source like DockerHub, it will also have an associated username. Lastly, each version of the image has a specific tag (the default is latest
). Thus in the commands below, any instance of <image>
can be replaced with the corresponding (username/)repository(:tag)
that specifies the desired image.
docker pull <image>
docker pull continuumio/miniconda3
docker pull continuumio/miniconda3:4.5.11
docker image ls
# Alternative:
docker images
docker run --rm <image> <command>
docker container ls
# Alternative:
docker ps
docker stop <container>
You can reference the container by its ID or Name (you have to run docker container ls
to obtain this information).
docker run --rm -it <image>
# Depending on the Dockerfile, you may have to specify the executable to run
docker run --rm -it <image> bash
Dockerfile
in the current working directory:docker build -t <name-of-tag> .
# Remove exited containers:
docker ps -aq --no-trunc -f status=exited | xargs docker rm
# Remove untagged images:
docker images -q --filter dangling=true | xargs docker rmi
# Start with the xenial tag of the ubuntu image
FROM ubuntu:xenial
# Add contact info
MAINTAINER <name>, <email>
# Install software
RUN apt-get update && \
apt-get install -y --no-install-recommends \
emacs \
git \
nano
# Execute code
RUN mkdir /root/project
# Set the working directory
WORKDIR /root/project
# Copy file from local machine to Docker image
COPY file.txt /root/project/
# Copy directory from local machine to Docker image
COPY dir/ /root/project/dir/
# Run this command by default when running an interactive container
CMD [ "/bin/bash" ]
Launch Jupyter from a Docker container (see my comment on GitHub for details):
docker run -i -t -p 8888:8888 continuumio/miniconda3 /bin/bash -c "/opt/conda/bin/conda install -c conda-forge jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='0.0.0.0' --port=8888 --no-browser --allow-root"