> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinfoil.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Building your own image

> Build and publish a Docker image for your own source code, then reference it from tinfoil-config.yml.

The [quickstart](/containers/quickstart) deploys a **pre-built Docker image**. If you have another pre-built image, reference it directly in the `image` field of your [`tinfoil-config.yml`](/containers/configuration).

If instead you have source code you want to deploy, you'll need to build an image for it first. How you do this depends on the visibility of the repository:

* **Public source code** → use [`tinfoil-public-containers-template`](https://github.com/tinfoilsh/tinfoil-public-containers-template). When deploying public code you can do it all in one repo. The `public-containers` template contains one workflow that builds the image, updates the local config with the new digest, and releases a new version. Essentially, it consolidates the `tinfoil-containers-hello-world` repo and the `tinfoil-containers-template` repo.
* **Private source code** → keep your code in its own private repo and use [`tinfoil-containers-hello-world`](https://github.com/tinfoilsh/tinfoil-containers-hello-world) as the build-and-publish pattern (Dockerfile + workflow that pushes to GHCR). Then reference the published image from a `tinfoil-containers-template` fork like the quickstart.

<Note>
  If the **published image** is private (not just the source), Tinfoil needs registry credentials to pull it at deploy time. See [Private images](/containers/private-images). Public images work without any configuration.
</Note>
