Skip to main content
Inframan builds a container image for each service from its Dockerfile, on your infrastructure, and pushes it to your infrastructure’s registry: Artifact Registry on Google Cloud or Amazon ECR on AWS.

What you need

  • A Dockerfile for each service. Inframan builds only from Dockerfiles.
  • path and build.dockerfile in inframan.yaml, if the defaults don’t fit. path is the build context, and dockerfile is relative to it.
Images are built for linux/amd64.

Where builds run

You choose when you create the infrastructure: A build is stopped if it runs for longer than 30 minutes.

Builds that don’t need to happen

Inframan skips work that wouldn’t change anything:
  • Already built: if this commit was already built for the service, its image is reused.
  • Nothing changed: if none of the service’s watch_paths, or nothing in its build context, changed since its last image, the image is reused. In a monorepo this means a push that touches one service rebuilds only that service.
  • Shared builds: services with an identical build, the same context, Dockerfile and build arguments, are built once and share the image.
When a build does run, Docker’s layer cache is kept in your registry, so unchanged layers aren’t rebuilt.
inframan.yaml

Build arguments and secrets

  • Every plain variable from the service’s env and its env groups is passed to the build as a --build-arg. Declare it with ARG in your Dockerfile to use it.
  • Secrets marked for builds are mounted with BuildKit’s secret mount, so they never end up in an image layer. See Secrets at build time.
Because plain variables become build arguments, don’t put anything sensitive in env. Build arguments can be read from an image’s history. Use secrets.

How your code is fetched

Inframan clones the pushed commit’s branch with a shallow, single-branch clone. Git submodules and Git LFS files aren’t fetched, so vendor what the build needs or fetch it in your Dockerfile.

Before the build

To run tests or linters before an image is built, add pre_build steps to a pipeline. A failed step stops the release before anything is built.