Creating Docker Images#
Step 1: Create a Dockerhub Account#
Create a docker hub account if you don’t have one already.
Step 2: Create your DockerFile#
Example:
# Dockerfile
FROM prairielearn/grader-r
# Install R packages
RUN Rscript -e "install.packages('openintro')"
Step 3: Push your Docker image to DockerHub#
cd
into the directory containing your DockerFile, then run the following commands:
docker login
docker build -t <image-name> .
docker tag grader-r:latest <dockerusername>/<image-name>:latest
docker push <dockerusername>/<image-name>:latest
Step 4: Add your image to your PraireLearn question#
Ex. If you are using this Docker image for the external autograder, add the image to your markdown YAML header.
gradingMethod: External
externalGradingOptions:
enabled: true
image: <dockerusername>/grader-r # made an image that has openstats installed, otherwise use prairielearn/grader-r
entrypoint: /r_autograder/run.sh
timeout: 60