Most users never need to build the image — pull a published tag as described in the project README. This guide is for contributors and for the rare case where a locally built or pre-loaded image is useful.
Build the image using this git repository as the build context:
docker build \
--build-arg CONTAINER_VERSION=14.368.0 \
--build-arg FOUNDRY_VERSION=14.368 \
--tag ghcr.io/felddy/foundryvtt:14.368.0 \
https://github.com/felddy/foundryvtt-docker.git#developTo build images for other CPU architectures, use Docker's
buildx feature:
-
Clone the project:
git clone https://github.com/felddy/foundryvtt-docker.git cd foundryvtt-docker
-
Build with
buildx, selecting the target platform:docker buildx build \ --platform linux/amd64 \ --build-arg CONTAINER_VERSION=14.368.0 \ --build-arg FOUNDRY_VERSION=14.368 \ --output type=docker \ --tag ghcr.io/felddy/foundryvtt:14.368.0 .
A Foundry Virtual Tabletop distribution can be installed into the image at build time. The resulting image is significantly larger, but it starts faster because nothing is downloaded at startup, and authentication happens at build time rather than at run time.
Note
Credentials are only used to fetch a distribution; they are not stored in the resulting image.
docker build \
--build-arg CONTAINER_VERSION=14.368.0 \
--build-arg FOUNDRY_VERSION=14.368 \
--secret id=foundry_username,src=<(echo "<your_username>") \
--secret id=foundry_password,src=<(echo "<your_password>") \
--tag ghcr.io/felddy/foundryvtt:14.368.0 \
https://github.com/felddy/foundryvtt-docker.git#developTip
If your credentials are stored in a json file, as described in the secrets reference, extract and pass them as build secrets:
docker build \
--build-arg CONTAINER_VERSION=14.368.0 \
--build-arg FOUNDRY_VERSION=14.368 \
--secret id=foundry_username,src=<(jq -r '.foundry_username' path/to/credentials.json) \
--secret id=foundry_password,src=<(jq -r '.foundry_password' path/to/credentials.json) \
--tag ghcr.io/felddy/foundryvtt:14.368.0 \
https://github.com/felddy/foundryvtt-docker.git#developMore information about Docker build secrets is in the Docker documentation.
docker build \
--build-arg CONTAINER_VERSION=14.368.0 \
--build-arg FOUNDRY_VERSION=14.368 \
--build-arg FOUNDRY_RELEASE_URL='<temporary_url>' \
--tag ghcr.io/felddy/foundryvtt:14.368.0 \
https://github.com/felddy/foundryvtt-docker.git#develop