0. make sure docker is installed
- Linux users:
To do all three in one go:$ curl -O https://raw.githubusercontent.com/cyber-dojo/web/master/cli/install-docker.sh $ chmod +x install-docker.sh $ sudo ./install-docker.sh
- Mac and Windows users: install Docker Toolbox and open a Docker-Quickstart-Terminal
1. create a docker-image for just the languageMake this docker-image unit-test-framework agnostic.
If you are adding a new unit-test-framework to an existing language skip this step.
For example, suppose you were building Lisp
create a new folder for your language
eg.$ md lisp
in your language's folder, create a file called Dockerfile
$ cd Lisp $ touch DockerfileIf you can, base your new image on Alpine-linux as this will help keep images small. To do this make the first line of Dockerfile as followsFROM cyberdojofoundation/language-baseHere's one based on Alpine-linux (95 MB: C, assert) C (gcc)/assert/Dockerfile
Here's one not based on Alpine (Ubuntu 845 MB: C#, NUnit) C#/NUnit/Dockerfile
Dockerfileto try and build your docker-image.
For example$ docker build -t cyberdojo/lisp .which, if it completes, creates a new docker-image called
Dockerfile(and build context) in
.(the current folder).
2. create a docker-image for the language and unit-test-frameworkRepeat the same process, building
FROMthe docker-image you created in the previous step.
For example, suppose your Lisp unit-test framework is called lunit
create a new folder underneath your language folder
$ cd lisp $ md lunit
in your new test folder, create a file called
Dockerfile$ cd lisp/lunit $ touch DockerfileThe first line of this file must name the docker image you built for your language in the previous step.
Add lines for all the commands needed to install your unit-test framework prefixed with
RUN.FROM cyberdojo/lisp RUN apt-get install -y lispy-lunit RUN apt-get install -y ...If you do not need any commands you should still create a
Dockerfilewith the single
Dockerfileto try and build your image.
The name of an image takes the form hub-name/image-name. Do not include a version number in the image-name. For example$ docker build -t cyberdojo/lisp_lunit .which, if it completes, creates a new docker image called
.(the current folder).
- do not put any version numbers in the image name.