DirectorySecurity AdvisoriesPricing
Sign inTry Starter for free
Directory
terrakube-api-server logo

terrakube-api-server

packaged by Chainguard

Last changed
Start with 5 free container images

Catalog Starter gives your team 5 production-grade container images, free forever, with no contract or sales call. Sign up with your work email.

Try Starter for free
Chainguard HarnessHack your app with frontier AI

Chainguard Harness uses frontier models from Anthropic, OpenAI, and Google to attack a copy of your app built on terrakube-api-server. It finds exploitable, validated issues that SAST and DAST tools aren't built to find.

Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for terrakube-api-server

Terrakube is an open source Infrastructure as Code automation platform, a self-hosted alternative to Terraform Cloud.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/terrakube-api-server:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Compatibility Notes

Terrakube is published as four images, all built from the terrakube-io/terrakube repository. Each replaces one upstream image:

Chainguard imageUpstream imagePort

cgr.dev/ORGANIZATION/terrakube-api-server

azbuilder/api-server

8080

cgr.dev/ORGANIZATION/terrakube-open-registry

azbuilder/open-registry

8075

cgr.dev/ORGANIZATION/terrakube-executor

azbuilder/executor

8090

cgr.dev/ORGANIZATION/terrakube-ui

azbuilder/terrakube-ui

8080

The differences from upstream are:

  • Upstream builds the three Java services with Paketo buildpacks and starts them through /cnb/process/web. These images run the same Spring Boot jars directly with java -jar on the OpenJDK 25 runtime. The jars are in /usr/share/java/terrakube/. Paketo's memory calculator is not included, so set JVM memory flags through JAVA_TOOL_OPTIONS if you need them.
  • All four images run as the nonroot user (UID 65532). Upstream runs the Java services as UID 1002 and the UI as UID 101.
  • As in upstream, the executor image includes bash, git, jq and curl for the scripts that jobs run.
  • The UI image runs nginx directly, set up the same way as upstream's nginx-unprivileged base: it listens on port 8080 and keeps its PID file and temporary files in /tmp. Mount the runtime configuration at /usr/share/nginx/html/env-config.js, as upstream's Docker Compose stack does.
  • No FIPS variant is available yet. The Java services use the non-FIPS BouncyCastle library for SSH access to Git module sources. They also hardcode a JKS trust store type for Redis TLS.

Getting Started

Terrakube needs a database (PostgreSQL, or in-memory H2 for evaluation), a Redis-compatible server, and an OpenID Connect provider such as Dex. The following commands start the services on one Docker network, using H2, valkey, and a shared signing secret for the internal tokens that the components use to talk to each other:

docker network create terrakube
docker run -d --name valkey --network terrakube cgr.dev/ORGANIZATION/valkey:latest

SECRET=$(openssl rand -base64 32 | tr '/+' '_-' | tr -d '=')

docker run -d --name api --network terrakube -p 8080:8080 \
  -e ApiDataSourceType=H2 \
  -e AuthenticationValidationType=DEX -e GroupValidationType=DEX -e UserValidationType=DEX \
  -e DexClientId=terrakube-app -e DexIssuerUri=http://dex:5556/dex \
  -e InternalSecret="$SECRET" -e PatSecret="$SECRET" \
  -e StorageType=LOCAL \
  -e TerrakubeHostname=localhost:8080 \
  -e TerrakubeRedisHostname=valkey -e TerrakubeRedisPort=6379 \
  -e AzBuilderExecutorUrl=http://executor:8090/api/v1/terraform-rs \
  -e TerrakubeUiURL=http://localhost:3000 \
  -e TerrakubeToolsRepository=https://github.com/terrakube-io/terrakube-extensions.git \
  -e TerrakubeToolsBranch=main \
  cgr.dev/ORGANIZATION/terrakube-api-server:latest

docker run -d --name executor --network terrakube \
  -e AzBuilderApiUrl=http://api:8080 -e TerrakubeApiUrl=http://api:8080 \
  -e InternalSecret="$SECRET" -e TerrakubeEnableSecurity=true \
  -e TerraformStateType=LocalTerraformStateImpl \
  -e TerraformOutputType=LocalTerraformOutputImpl \
  -e TerrakubeRedisHostname=valkey -e TerrakubeRedisPort=6379 \
  -e TerrakubeRegistryDomain=localhost:8075 \
  -e TerrakubeToolsRepository=https://github.com/terrakube-io/terrakube-extensions.git \
  -e TerrakubeToolsBranch=main \
  cgr.dev/ORGANIZATION/terrakube-executor:latest

docker run -d --name registry --network terrakube -p 8075:8075 \
  -e AzBuilderApiUrl=http://api:8080 -e AzBuilderRegistry=http://localhost:8075 \
  -e AuthenticationValidationTypeRegistry=DEX -e TerrakubeEnableSecurity=true \
  -e AppClientId=terrakube-app -e AppIssuerUri=http://dex:5556/dex \
  -e DexIssuerUri=http://dex:5556/dex \
  -e InternalSecret="$SECRET" -e PatSecret="$SECRET" \
  -e RegistryStorageType=Local -e TerrakubeUiURL=http://localhost:3000 \
  cgr.dev/ORGANIZATION/terrakube-open-registry:latest

Check that the API and the registry are up:

curl -s http://localhost:8080/actuator/health
curl -s http://localhost:8075/.well-known/terraform.json

The UI reads its settings from env-config.js. Create one that points at your API, registry and identity provider, and mount it into the UI container:

cat > env-config.js <<'JS'
window._env_ = {
  REACT_APP_TERRAKUBE_API_URL: "http://localhost:8080/api/v1/",
  REACT_APP_CLIENT_ID: "terrakube-app",
  REACT_APP_AUTHORITY: "http://localhost:5556/dex",
  REACT_APP_REDIRECT_URI: "http://localhost:3000",
  REACT_APP_REGISTRY_URI: "http://localhost:8075",
  REACT_APP_SCOPE: "email openid profile offline_access groups",
  REACT_APP_TERRAKUBE_SEND_COOKIES: "false",
}
JS

docker run -d --name ui --network terrakube -p 3000:8080 \
  -v "$PWD/env-config.js:/usr/share/nginx/html/env-config.js:ro" \
  cgr.dev/ORGANIZATION/terrakube-ui:latest

You need a running OpenID Connect provider at the configured authority to sign in. Upstream's Docker Compose stack shows a full deployment with Dex, PostgreSQL and S3-compatible storage. You can use it with these images by replacing the azbuilder/* image references.

Configuration

All three Java services are configured with environment variables. The upstream Docker Compose file lists the full set for each service. For a production deployment:

  • Set ApiDataSourceType=POSTGRESQL and the Datasource* variables on the API.
  • Use object storage for state and outputs. For example, set StorageType=AWS on the API and TerraformStateType=AwsTerraformStateImpl and TerraformOutputType=AwsTerraformOutputImpl on the executor.
  • Give every component the same InternalSecret. The executor and the registry use it to sign their calls to the API.

Paths that the services write to, such as the executor's Terraform working directories, are created under the home directory of the nonroot user. A volume mounted there must be writable by UID 65532.

Documentation and Resources

What are Chainguard Containers?

Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.

All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.

The main features of Chainguard Containers include:

For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.

In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.

Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.

Need additional packages?

To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.

To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.

Learn More

Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.

Trademarks

This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.

Licenses

Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

    For a complete list of licenses, please refer to this Image's SBOM.

    Software license agreement

    Compliance

    Chainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.

    SLSA compliance at Chainguard

    This image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.

    PCI DSS at Chainguard

    Category
    Application

    The trusted source for open source

    Talk to an expert
    PrivacyTerms

    Product

    Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
    © 2026 Chainguard, Inc. All Rights Reserved.
    Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
    The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.