-
Notifications
You must be signed in to change notification settings - Fork 129
User_Docker
This page is a cheat sheet for users (participants or organizers) who want to run their code in their own docker. If you are an organizer, you can specify your new docker as a competition property in the competition YAML file or the editor. Contact us if you need participants to specify their own docker.
Imagine that you want to change/modify the version of Python Codalab competition used by default codalab/default
, which points right now to docker-codalab-legacy-worker a.k.a. codalab/codalab-legacy
.
One way to modify the default docker is to:
- Install docker. Create a repo e.g. myrepo/codalab
- At the prompt, type:
docker run -itd -u root codalab/codalab-legacy /bin/bash
- Use
docker ps
to find running container id. - Now run
docker exec -it -u root 78e82f680994 bash
- The prompt will look like
root@78e82f680994$
, make a note of the container ID e.g.78e82f680994
. - Install anything you want at the docker container shell
- Exit the shell with
exit
-
docker commit 78e82f680994 myrepo/codalab:legacy
(replacelegacy
by another name or a version number) docker login
docker push myrepo/codalab:legacy
Another way to modify the default docker is to:
- Install docker. Create a repo e.g. myrepo/codalab
- Folk or download docker-codalab-legacy-worker from Github.
- Put the docker image in a new directory and modify Dockerfile:
mkdir codalab
cp /path/to/docker-codalab-legacy-worker/Dockerfile codalab/Dockerfile
cd codalab
vim Dockerfile
-
Build docker:
docker build -t myrepo/codalab:legacy .
Be sure to run the docker build command from within the directory that contains the Dockerfile. -
Push your image to the repo:
docker push myrepo/codalab:legacy
CREDITS: This page is inspired by this cheat sheet.