LogoLogo
Bonsai (0.13) DocsGitHubDiscord CommunityGarden Enterprise
Docs Edge
Docs Edge
  • Welcome to Garden!
  • Overview
    • What is Garden
    • Use Cases
      • Isolated On-Demand Preview Environments
      • Fast, Portable CI Pipelines that Run Anywhere
      • Shift Testing Left
      • Local Development With Remote Clusters
      • Jumpstart your Internal Developer Platform
    • Garden vs Other Tools
  • Getting Started
    • Quickstart
    • Garden Basics
    • Next Steps
  • Tutorials
    • Your First Project
      • 1. Create a Garden Project
      • 2. Pick a Kubernetes Plugin
      • 3. Add Actions
      • 4. Add Tests
      • 5. Code Syncing (Hot Reload)
      • 6. Next Steps
    • Setting up a Kubernetes cluster
      • 1. Create a Cluster
        • AWS
        • GCP
        • Azure
      • 2. Configure Container Registry
        • AWS
        • GCP
        • Azure
        • Docker Hub
      • 3. Set Up Ingress, TLS and DNS
      • 4. Configure the Provider
  • Using Garden With
    • Containers
      • Using Remote Container Builder
      • Building Containers
    • Kubernetes
      • Using Remote Kubernetes
      • Using Local Kubernetes
      • Deploying K8s Resources
      • Installing Helm charts
      • Running Tests and Tasks
    • Terraform
      • Using Terraform
      • Applying Terrform Stacks
    • Pulumi
      • Using Pulumi
      • Applying Pulumi Stacks
    • Local Scripts
  • Features
    • Remote Container Builder
    • Team Caching
    • Variables and Templating
    • Config Templates
    • Workflows
    • Code Synchronization
    • Custom Commands
    • Remote Sources
  • Guides
    • Connecting a Project
    • Environments and Namespaces
    • Installing Garden
    • Including/Excluding files
    • Installing Local Kubernetes
    • Migrating from Docker Compose to Garden
    • Using the CLI
    • Using Garden in CircleCI
    • Minimal RBAC Configuration for Development Clusters
    • Deploying to Production
    • Using a Registry Mirror
    • Local mode
  • Reference
    • Providers
      • container
      • ephemeral-kubernetes
      • exec
      • jib
      • kubernetes
      • local-kubernetes
      • otel-collector
      • pulumi
      • terraform
    • Action Types
      • Build
        • container Build
        • exec Build
        • jib-container Build
      • Deploy
        • configmap Deploy
        • container Deploy
        • exec Deploy
        • helm Deploy
        • kubernetes Deploy
        • persistentvolumeclaim Deploy
        • pulumi Deploy
        • terraform Deploy
      • Run
        • container Run
        • exec Run
        • helm-pod Run
        • kubernetes-exec Run
        • kubernetes-pod Run
      • Test
        • container Test
        • exec Test
        • helm-pod Test
        • kubernetes-exec Test
        • kubernetes-pod Test
    • Template Strings
      • Project template context
      • Environment template context
      • Provider template context
      • Action (all fields) template context
      • Action spec template context
      • Module template context
      • Remote Source template context
      • Project Output template context
      • Custom Command template context
      • Workflow template context
      • Template Helper Functions
    • Commands
    • Project Configuration
    • ConfigTemplate Reference
    • RenderTemplate Reference
    • Workflow Configuration
    • Garden Containers on Docker Hub
    • Glossary
    • Module Template Configuration
    • Module Types
      • configmap
      • container
      • exec
      • helm
      • jib-container
      • kubernetes
      • persistentvolumeclaim
      • pulumi
      • templated
      • terraform
  • Misc
    • FAQ
    • Troubleshooting
    • Telemetry
    • How Organizations Adopt Garden
    • New Garden Cloud Version
    • Migrating to Bonsai
  • Contributing to Garden
    • Contributor Covenant Code of Conduct
    • Contributing to the Docs
    • Setting up Your Developer Environment
    • Developing Garden
    • Config Resolution
    • Graph Execution
Powered by GitBook
On this page
  • Description
  • Complete YAML Schema
  • Configuration Keys
  • kind
  • type
  • name
  • build
  • build.dependencies[]
  • build.dependencies[].name
  • build.dependencies[].copy[]
  • build.dependencies[].copy[].source
  • build.dependencies[].copy[].target
  • build.timeout
  • build.targetImage
  • local
  • description
  • disabled
  • include[]
  • exclude[]
  • repositoryUrl
  • allowPublish
  • generateFiles[]
  • generateFiles[].sourcePath
  • generateFiles[].targetPath
  • generateFiles[].resolveTemplates
  • generateFiles[].value
  • variables
  • varfile
  • buildArgs
  • extraFlags[]
  • platforms[]
  • secrets
  • image
  • dockerfile
  • services[]
  • services[].name
  • services[].dependencies[]
  • services[].disabled
  • services[].command[]
  • services[].args[]
  • services[].env
  • services[].cpu
  • services[].cpu.min
  • services[].cpu.max
  • services[].memory
  • services[].memory.min
  • services[].memory.max
  • services[].volumes[]
  • services[].volumes[].name
  • services[].volumes[].containerPath
  • services[].volumes[].hostPath
  • services[].privileged
  • services[].addCapabilities[]
  • services[].dropCapabilities[]
  • services[].tty
  • services[].deploymentStrategy
  • services[].annotations
  • services[].daemon
  • services[].sync
  • services[].sync.args[]
  • services[].sync.command[]
  • services[].sync.paths[]
  • services[].sync.paths[].source
  • services[].sync.paths[].target
  • services[].sync.paths[].exclude[]
  • services[].sync.paths[].mode
  • services[].sync.paths[].defaultFileMode
  • services[].sync.paths[].defaultDirectoryMode
  • services[].sync.paths[].defaultOwner
  • services[].sync.paths[].defaultGroup
  • services[].image
  • services[].ingresses[]
  • services[].ingresses[].annotations
  • services[].ingresses[].hostname
  • services[].ingresses[].linkUrl
  • services[].ingresses[].path
  • services[].ingresses[].port
  • services[].healthCheck
  • services[].healthCheck.httpGet
  • services[].healthCheck.httpGet.path
  • services[].healthCheck.httpGet.port
  • services[].healthCheck.httpGet.scheme
  • services[].healthCheck.command[]
  • services[].healthCheck.tcpPort
  • services[].healthCheck.readinessTimeoutSeconds
  • services[].healthCheck.livenessTimeoutSeconds
  • services[].timeout
  • services[].limits
  • services[].limits.cpu
  • services[].limits.memory
  • services[].ports[]
  • services[].ports[].name
  • services[].ports[].protocol
  • services[].ports[].containerPort
  • services[].ports[].localPort
  • services[].ports[].servicePort
  • services[].ports[].hostPort
  • services[].ports[].nodePort
  • services[].replicas
  • tests[]
  • tests[].name
  • tests[].dependencies[]
  • tests[].disabled
  • tests[].timeout
  • tests[].command[]
  • tests[].args[]
  • tests[].env
  • tests[].cpu
  • tests[].cpu.min
  • tests[].cpu.max
  • tests[].memory
  • tests[].memory.min
  • tests[].memory.max
  • tests[].volumes[]
  • tests[].volumes[].name
  • tests[].volumes[].containerPath
  • tests[].volumes[].hostPath
  • tests[].privileged
  • tests[].addCapabilities[]
  • tests[].dropCapabilities[]
  • tests[].tty
  • tests[].deploymentStrategy
  • tests[].artifacts[]
  • tests[].artifacts[].source
  • tests[].artifacts[].target
  • tests[].image
  • tests[].cacheResult
  • tasks[]
  • tasks[].name
  • tasks[].description
  • tasks[].dependencies[]
  • tasks[].disabled
  • tasks[].timeout
  • tasks[].command[]
  • tasks[].args[]
  • tasks[].env
  • tasks[].cpu
  • tasks[].cpu.min
  • tasks[].cpu.max
  • tasks[].memory
  • tasks[].memory.min
  • tasks[].memory.max
  • tasks[].volumes[]
  • tasks[].volumes[].name
  • tasks[].volumes[].containerPath
  • tasks[].volumes[].hostPath
  • tasks[].privileged
  • tasks[].addCapabilities[]
  • tasks[].dropCapabilities[]
  • tasks[].tty
  • tasks[].deploymentStrategy
  • tasks[].artifacts[]
  • tasks[].artifacts[].source
  • tasks[].artifacts[].target
  • tasks[].image
  • tasks[].cacheResult
  • Outputs
  • Module Outputs
  • ${modules.<module-name>.buildPath}
  • ${modules.<module-name>.name}
  • ${modules.<module-name>.path}
  • ${modules.<module-name>.var.*}
  • ${modules.<module-name>.var.<variable-name>}
  • ${modules.<module-name>.version}
  • ${modules.<module-name>.outputs.local-image-name}
  • ${modules.<module-name>.outputs.local-image-id}
  • ${modules.<module-name>.outputs.deployment-image-name}
  • ${modules.<module-name>.outputs.deployment-image-id}
  • Service Outputs
  • ${runtime.services.<service-name>.version}
  • Task Outputs
  • ${runtime.tasks.<task-name>.version}

Was this helpful?

  1. Reference
  2. Module Types

container

PreviousconfigmapNextexec

Last updated 1 month ago

Was this helpful?

Modules are deprecated and will be removed in version 0.14. Please use -based configuration instead. See the for details.

Description

Specify a container image to build or pull from a remote registry. You may also optionally specify services to deploy, tasks or tests to run inside the container.

Note that the runtime services have somewhat limited features in this module type. For example, you cannot specify replicas for redundancy, and various platform-specific options are not included. For those, look at other module types like or.

Below is the full schema reference.

The contains the complete YAML schema, and the describes each schema key.

container modules also export values that are available in template strings. See the section below for details.

Complete YAML Schema

The values in the schema below are the default values.

kind: Module

# The type of this module.
type:

# The name of this module.
name:

# Specify how to build the module. Note that plugins may define additional keys on this object.
build:
  # A list of modules that must be built before this module is built.
  dependencies:
    - # Module name to build ahead of this module.
      name:

      # Specify one or more files or directories to copy from the built dependency to this module.
      copy:
        - # POSIX-style path or filename of the directory or file(s) to copy to the target.
          source:

          # POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
          # Defaults to the same as source path.
          target:

  # Maximum time in seconds to wait for build to finish.
  timeout: 600

  # For multi-stage Dockerfiles, specify which image/stage to build (see
  # https://docs.docker.com/engine/reference/commandline/build/#specifying-target-build-stage---target for details).
  targetImage:

# If set to true, Garden will run the build command, services, tests, and tasks in the module source directory,
# instead of in the Garden build directory (under .garden/build/<module-name>).
#
# Garden will therefore not stage the build for local modules. This means that include/exclude filters
# and ignore files are not applied to local modules, except to calculate the module/action versions.
#
# If you use use `build.dependencies[].copy` for one or more build dependencies of this module, the copied files
# will be copied to the module source directory (instead of the build directory, as is the default case when
# `local = false`).
#
# Note: This maps to the `buildAtSource` option in this module's generated Build action (if any).
local: false

# A description of the module.
description:

# Set this to `true` to disable the module. You can use this with conditional template strings to disable modules
# based on, for example, the current environment or other variables (e.g. `disabled: ${environment.name == "prod"}`).
# This can be handy when you only need certain modules for specific environments, e.g. only for development.
#
# Disabling a module means that any services, tasks and tests contained in it will not be build, deployed or run.
#
# If you disable the module, and its services, tasks or tests are referenced as _runtime_ dependencies, Garden will
# automatically ignore those dependency declarations. Note however that template strings referencing the module's
# service or task outputs (i.e. runtime outputs) will fail to resolve when the module is disabled, so you need to make
# sure to provide alternate values for those if you're using them, using conditional expressions.
disabled: false

# Specify a list of POSIX-style paths or globs that should be regarded as the source files for this module. Files that
# do *not* match these paths or globs are excluded when computing the version of the module, when responding to
# filesystem watch events, and when staging builds.
#
# Note that you can also _exclude_ files using the `exclude` field or by placing `.gardenignore` files in your source
# tree, which use the same format as `.gitignore` files. See the [Configuration Files
# guide](https://docs.garden.io/cedar-0.14/using-garden/configuration-overview#including-excluding-files-and-directories)
# for details.
#
# Also note that specifying an empty list here means _no sources_ should be included.
#
# If neither `include` nor `exclude` is set, and the module has a Dockerfile, Garden
# will parse the Dockerfile and automatically set `include` to match the files and
# folders added to the Docker image (via the `COPY` and `ADD` directives in the Dockerfile).
#
# If neither `include` nor `exclude` is set, and the module
# specifies a remote image, Garden automatically sets `include` to `[]`.
include: