Interface Container

Container specifies the metadata for a component of a Service.

interface Container {
    build?: string | ContainerBuild;
    command?: Input<string[]>;
    cpu?: Input<number>;
    dockerLabels?: Input<{
        [name: string]: string;
    }>;
    environment?: {
        [name: string]: pulumi.Input<string>;
    };
    function?: (() => void);
    image?: Input<string>;
    memory?: Input<number>;
    memoryReservation?: Input<number>;
    ports?: ContainerPort[];
    volumes?: ContainerVolumeMount[];
}

Hierarchy (view full)

Properties

build?: string | ContainerBuild

Either a path to a folder in which a Docker build should be run to construct the image for this Container, or a ContainerBuild object with more detailed build instructions. If image is also specified, the built container will be tagged with that name, but otherwise will get an auto-generated image name.

command?: Input<string[]>

The command line that is passed to the container. This parameter maps to Cmd in the Create a container section of the Docker Remote API and the COMMAND parameter to docker run. For more information about the Docker CMD parameter, go to https://docs.docker.com/engine/reference/builder/#cmd.

cpu?: Input<number>

Number of CPUs for the container to use. Maps to the Docker --cpus option - see https://docs.docker.com/engine/reference/commandline/run.

dockerLabels?: Input<{
    [name: string]: string;
}>

A key/value map of labels to add to the container. This parameter maps to Labels in the Create a container section of the Docker Remote API and the --label option to docker run.

Type declaration

  • [name: string]: string
environment?: {
    [name: string]: pulumi.Input<string>;
}

Optional environment variables to set and make available to the container as it is running.

Type declaration

  • [name: string]: pulumi.Input<string>
function?: (() => void)

The function code to use as the implementation of the contaner. If function is specified, neither image nor build are legal.

Type declaration

    • (): void
    • Returns void

image?: Input<string>

The image to use for the container. If image is specified, but not build, the image will be pulled from the Docker Hub. If image and build are specified, the image controls the resulting image tag for the build image that gets pushed.

memory?: Input<number>

The maximum amount of memory the container will be allowed to use. Maps to the Docker --memory option - see https://docs.docker.com/engine/reference/commandline/run.

This should be supplied in MB. i.e. A value of 1024 would equal one gigabyte.

memoryReservation?: Input<number>

The amount of memory to reserve for the container, but the container will be allowed to use more memory if it's available. At least one of memory and memoryReservation must be specified. Maps to the Docker --memory-reservation option - see https://docs.docker.com/engine/reference/commandline/run.

This should be supplied in MB. i.e. A value of 1024 would equal one gigabyte.

ports?: ContainerPort[]

An array of ports to publish from the container. Ports are exposed using the TCP protocol. If the [external] flag is true, the port will be exposed to the Internet even if the service is running in a private network. Maps to the Docker --publish option - see https://docs.docker.com/engine/reference/commandline/run.

An array of volume mounts, indicating a volume to mount and a path within the container at which to mount the volume. Maps to the Docker --volume option - see https://docs.docker.com/engine/reference/commandline/run.

Generated using TypeDoc