Skip to main content

Docker Images

Pupilfirst uses Docker to build and release official images to our Docker Hub account. These images are built automatically using Github CI on the project repo.

However, there may be situations in which you do not wish to use these official images. For example, if you've made changes to your fork of Pupilfirst, then you'll want to deploy Docker images that incorporate those changes.

You can build your own Docker image locally:

# From the root of the repo...
docker build -t pupilfirst .

This command will instruct Docker to locally build an image using instructions in the Dockerfile, and to tag the resulting image as pupilfirst.

Once an image has been built, you can run it locally, and even inspect its contents:

# Start a container using the `pupilfirst` image, and run bash.
docker run -it --entrypoint bash pupilfirst

Once you've confirmed that your image is functioning properly, you can add new tags to the local image and push it to your target container registry, such as Docker Hub, Heroku Container Registry, or DigitalOcean Container Registry.

First, add new tags to your local image:

# Let's use Heroku as an example.
docker tag pupilfirst
docker tag pupilfirst

Once the tags are in place, you can use the push command:

# Heroku Container Registry
docker push
docker push

# DigitalOcean Container Registry
docker push

# Docker Hub
docker push USERNAME/pupilfirst:latest

You will need to perform additional steps beforehand to be allowed to push to these container registries; please browse their documentation for more information.