Reference documentation and code samples for the Google Cloud Run V2 Client class Container.
A single application container.
This specifies both the container to run, the command to run in the container and the arguments to supply to it. Note that additional arguments can be supplied by the system to the container at runtime.
Generated from protobuf message google.cloud.run.v2.Container
Namespace
Google \ Cloud \ Run \ V2Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Name of the container specified as a DNS_LABEL (RFC 1123).
↳ image
string
Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.
↳ command
array
Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.
↳ args
array
Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
↳ env
↳ resources
↳ ports
array< ContainerPort
>
List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible. If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.
↳ volume_mounts
↳ working_dir
string
Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.
↳ liveness_probe
↳ startup_probe
Probe
Startup probe of application within the container. All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.
↳ depends_on
array
Names of the containers that must start before this container.
↳ base_image_uri
string
Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.
↳ build_info
getName
Name of the container specified as a DNS_LABEL (RFC 1123).
string
setName
Name of the container specified as a DNS_LABEL (RFC 1123).
var
string
$this
getImage
Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.
string
setImage
Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.
var
string
$this
getCommand
Entrypoint array. Not executed within a shell.
The docker image's ENTRYPOINT is used if this is not provided.
setCommand
Entrypoint array. Not executed within a shell.
The docker image's ENTRYPOINT is used if this is not provided.
var
string[]
$this
getArgs
Arguments to the entrypoint.
The docker image's CMD is used if this is not provided.
setArgs
Arguments to the entrypoint.
The docker image's CMD is used if this is not provided.
var
string[]
$this
getEnv
List of environment variables to set in the container.
setEnv
List of environment variables to set in the container.
$this
getResources
Compute Resource requirements by this container.
hasResources
clearResources
setResources
Compute Resource requirements by this container.
$this
getPorts
List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.
If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.
setPorts
List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.
If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.
$this
getVolumeMounts
Volume to mount into the container's filesystem.
setVolumeMounts
Volume to mount into the container's filesystem.
$this
getWorkingDir
Container's working directory.
If not specified, the container runtime's default will be used, which might be configured in the container image.
string
setWorkingDir
Container's working directory.
If not specified, the container runtime's default will be used, which might be configured in the container image.
var
string
$this
getLivenessProbe
Periodic probe of container liveness.
Container will be restarted if the probe fails.
hasLivenessProbe
clearLivenessProbe
setLivenessProbe
Periodic probe of container liveness.
Container will be restarted if the probe fails.
$this
getStartupProbe
Startup probe of application within the container.
All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.
hasStartupProbe
clearStartupProbe
setStartupProbe
Startup probe of application within the container.
All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.
$this
getDependsOn
Names of the containers that must start before this container.
setDependsOn
Names of the containers that must start before this container.
var
string[]
$this
getBaseImageUri
Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.
string
setBaseImageUri
Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.
var
string
$this
getBuildInfo
Output only. The build info of the container image.
hasBuildInfo
clearBuildInfo
setBuildInfo
Output only. The build info of the container image.
$this