Container
Container defines a structure for creating Docker containers
Attributes
Attributes are the properties of a resource that can be used to configure it.
Network attaches the container to an existing network defined in a separate stanza. This block can be specified multiple times to attach the container to multiple networks.
Image defines a Docker image to use when creating the container.
Entrypoint entrypoint
[]string
Entrypoint for the container, if not set, Jumppad starts the container using the entrypoint defined in the Docker image.
Command command
[]string
Command allows you to specify a command to execute when starting a container. Command is specified as an array of strings, each part of the command is a separate string.
For example, to start a container and follow logs at /dev/null the following command could be used.
Environment environment
map[string]string
Allows you to set environment variables in the container.
Labels labels
map[string]string
Labels to apply to the container
A volume allows you to specify a local volume which is mounted to the container when it is created. This stanza can be specified multiple times.
A port stanza allows you to expose container ports on the local network or host. This stanza can be specified multiple times.
A port_range stanza allows you to expose a range of container ports on the local network or host. This stanza can be specified multiple times.
The following example would create 11 ports from 80 to 90 (inclusive) and expose them to the host machine.
DNS dns
[]string
Privileged privileged
bool
Should the container run in Docker privileged mode?
MaxRestartCount max_restart_count
int
The maximum number of times a container will be restarted when it exits with a status code other than 0
Define resource constraints for the container
Define a health check for the container, the resource will only be marked as successfully created when the health check passes.
Allows the container to be run as a specific user or group.
Computed Attributes
These attributes are computed when the config is parsed and applied, and are therefor only known at parsetime or runtime.
Meta ID meta.id
string
The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:
Meta Type meta.type
string
The type of the resource. This taken from the type label of the resource definition.
Meta Name meta.name
string
The name of the resource. This taken from the name label of the resource definition.
ContainerName container_name
string
Fully qualified resource name for the container, this value can be used to access the container from within the Docker network. `container_name` is also the name of the created Docker container.
Examples
Minimal Example
Full Example
Last updated