Using a Docker Image#
We provide a Docker file (Dockerfile
) that can be used to build a Docker image. This
Docker image is intended to be used for running experiments, but can also be used for
development.
Requirements#
To build a Docker image, you need to fill in the appropriate values in your .env
file (the one you created from .env.template
in the Installation Steps). In
particular, you need the following:
A GitHub personal access token (PAT). This is used to clone the repository inside the Docker container, and also push any changes back to the repository. You can create a PAT by following the instructions in the GitHub documentation. Ideally, use a fine-grained one that has (read-write) access only to the contents of this repository.
An SSH public key. This allows you to access the Docker container via SSH.
A Weights & Biases API key. This is used to log experiment data.
A name (probably your full name) and email address for signing git commits.
If you want to push the image to Docker Hub, you will also need a Docker Hub account.
Building and Pushing the Image#
First make sure you have filled in the appropriate values in your .env
file.
You also need to authenticate to the GitHub Container Registry (GHCR), which you can do by following this guide in the GitHub documentation.
Then, you can build the Docker image using the following command:
docker build -t DOCKER_USER/DOCKER_REPO:DOCKER_TAG --target default --secret id=my_env,src=.env --build-arg CACHE_BUST=`git rev-parse main` .
replacing DOCKER_USER
with your Docker Hub username, and DOCKER_REPO
and
DOCKER_TAG
suitable Docker repository and tag names (e.g.
“neural-interactive-proofs/default”).
If you want to host language models for inference and training, you can build the
image using the lm-server
target instead of default
. This will include
the necessary dependencies for running language models
docker build -t DOCKER_USER/DOCKER_REPO:DOCKER_TAG --target lm-server --secret id=my_env,src=.env --build-arg CACHE_BUST=`git rev-parse main` .
To push the image to Docker Hub, use the following command:
docker push DOCKER_USER/DOCKER_REPO:DOCKER_TAG