Update 2024-06-07: Much of this repo has been reworked into a template repo victorlin/github-actions-docker-build with a more generalized scoping of "building and publishing a Docker image on GitHub".
Nextstrain's Docker image provides software tooling that supports most use cases, however there are times when one wants to use software that is not included in that image. This repository demonstrates how to create your own image.
Something similar was requested on the Nextstrain discussion forum.
Fork this repository, or add all its contents into an existing repository. You will need a GitHub account to continue.
The Dockerfile defines customizations to Nextstrain's image. The method used varies by software. Refer to Docker Docs or look at Nextstrain's Dockerfile for examples.
Once the Dockerfile has been updated on GitHub, it will automatically trigger a build of the image on GitHub Container Registry as an image tagged with the repository's name and owner.
Note
The first push in a repository may fail due to lack of GitHub permissions on a package that hasn't been created yet. Subsequent pushes should succeed.
Use the image with Nextstrain CLI by specifying it as --image
in supported
commands. --docker
is required if it is not your default runtime. Examples:
nextstrain build --docker --image=ghcr.io/victorlin/custom-docker .
nextstrain shell --docker --image=ghcr.io/victorlin/custom-docker .
Note
You can also build it locally if you have Docker installed. Example:
./build --load --tag custom-local-image
nextstrain shell --docker --image=custom-local-image .
Based on work in https://github.com/nextstrain/docker-base.