Class Container (0.62.0)

publicfinalclass ContainerextendsGeneratedMessageV3implementsContainerOrBuilder

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.

Protobuf type google.cloud.run.v2.Container

Implements

ContainerOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

ARGS_FIELD_NUMBER

publicstaticfinalintARGS_FIELD_NUMBER
Field Value
Type Description
int

BASE_IMAGE_URI_FIELD_NUMBER

publicstaticfinalintBASE_IMAGE_URI_FIELD_NUMBER
Field Value
Type Description
int

BUILD_INFO_FIELD_NUMBER

publicstaticfinalintBUILD_INFO_FIELD_NUMBER
Field Value
Type Description
int

COMMAND_FIELD_NUMBER

publicstaticfinalintCOMMAND_FIELD_NUMBER
Field Value
Type Description
int

DEPENDS_ON_FIELD_NUMBER

publicstaticfinalintDEPENDS_ON_FIELD_NUMBER
Field Value
Type Description
int

ENV_FIELD_NUMBER

publicstaticfinalintENV_FIELD_NUMBER
Field Value
Type Description
int

IMAGE_FIELD_NUMBER

publicstaticfinalintIMAGE_FIELD_NUMBER
Field Value
Type Description
int

LIVENESS_PROBE_FIELD_NUMBER

publicstaticfinalintLIVENESS_PROBE_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

publicstaticfinalintNAME_FIELD_NUMBER
Field Value
Type Description
int

PORTS_FIELD_NUMBER

publicstaticfinalintPORTS_FIELD_NUMBER
Field Value
Type Description
int

RESOURCES_FIELD_NUMBER

publicstaticfinalintRESOURCES_FIELD_NUMBER
Field Value
Type Description
int

STARTUP_PROBE_FIELD_NUMBER

publicstaticfinalintSTARTUP_PROBE_FIELD_NUMBER
Field Value
Type Description
int

VOLUME_MOUNTS_FIELD_NUMBER

publicstaticfinalintVOLUME_MOUNTS_FIELD_NUMBER
Field Value
Type Description
int

WORKING_DIR_FIELD_NUMBER

publicstaticfinalintWORKING_DIR_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticContainergetDefaultInstance()
Returns
Type Description
Container

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticContainer.BuildernewBuilder()
Returns
Type Description
Container.Builder

newBuilder(Container prototype)

publicstaticContainer.BuildernewBuilder(Containerprototype)
Parameter
Name Description
prototype Container
Returns
Type Description
Container.Builder

parseDelimitedFrom(InputStream input)

publicstaticContainerparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticContainerparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticContainerparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticContainerparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticContainerparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticContainerparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticContainerparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticContainerparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticContainerparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticContainerparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticContainerparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticContainerparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Container>parser()
Returns
Type Description
Parser<Container>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getArgs(int index)

publicStringgetArgs(intindex)

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The args at the given index.

getArgsBytes(int index)

publicByteStringgetArgsBytes(intindex)

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the args at the given index.

getArgsCount()

publicintgetArgsCount()

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Returns
Type Description
int

The count of args.

getArgsList()

publicProtocolStringListgetArgsList()

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Returns
Type Description
ProtocolStringList

A list containing the args.

getBaseImageUri()

publicStringgetBaseImageUri()

Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.

string base_image_uri = 13;

Returns
Type Description
String

The baseImageUri.

getBaseImageUriBytes()

publicByteStringgetBaseImageUriBytes()

Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.

string base_image_uri = 13;

Returns
Type Description
ByteString

The bytes for baseImageUri.

getBuildInfo()

publicBuildInfogetBuildInfo()

Output only. The build info of the container image.

.google.cloud.run.v2.BuildInfo build_info = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
BuildInfo

The buildInfo.

getBuildInfoOrBuilder()

publicBuildInfoOrBuildergetBuildInfoOrBuilder()

Output only. The build info of the container image.

.google.cloud.run.v2.BuildInfo build_info = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
BuildInfoOrBuilder

getCommand(int index)

publicStringgetCommand(intindex)

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The command at the given index.

getCommandBytes(int index)

publicByteStringgetCommandBytes(intindex)

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the command at the given index.

getCommandCount()

publicintgetCommandCount()

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Returns
Type Description
int

The count of command.

getCommandList()

publicProtocolStringListgetCommandList()

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Returns
Type Description
ProtocolStringList

A list containing the command.

getDefaultInstanceForType()

publicContainergetDefaultInstanceForType()
Returns
Type Description
Container

getDependsOn(int index)

publicStringgetDependsOn(intindex)

Names of the containers that must start before this container.

repeated string depends_on = 12;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The dependsOn at the given index.

getDependsOnBytes(int index)

publicByteStringgetDependsOnBytes(intindex)

Names of the containers that must start before this container.

repeated string depends_on = 12;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the dependsOn at the given index.

getDependsOnCount()

publicintgetDependsOnCount()

Names of the containers that must start before this container.

repeated string depends_on = 12;

Returns
Type Description
int

The count of dependsOn.

getDependsOnList()

publicProtocolStringListgetDependsOnList()

Names of the containers that must start before this container.

repeated string depends_on = 12;

Returns
Type Description
ProtocolStringList

A list containing the dependsOn.

getEnv(int index)

publicEnvVargetEnv(intindex)

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Parameter
Name Description
index int
Returns
Type Description
EnvVar

getEnvCount()

publicintgetEnvCount()

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Returns
Type Description
int

getEnvList()

publicList<EnvVar>getEnvList()

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Returns
Type Description
List<EnvVar>

getEnvOrBuilder(int index)

publicEnvVarOrBuildergetEnvOrBuilder(intindex)

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Parameter
Name Description
index int
Returns
Type Description
EnvVarOrBuilder

getEnvOrBuilderList()

publicList<?extendsEnvVarOrBuilder>getEnvOrBuilderList()

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Returns
Type Description
List<? extends com.google.cloud.run.v2.EnvVarOrBuilder>

getImage()

publicStringgetImage()

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 image = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The image.

getImageBytes()

publicByteStringgetImageBytes()

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 image = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for image.

getLivenessProbe()

publicProbegetLivenessProbe()

Periodic probe of container liveness. Container will be restarted if the probe fails.

.google.cloud.run.v2.Probe liveness_probe = 10;

Returns
Type Description
Probe

The livenessProbe.

getLivenessProbeOrBuilder()

publicProbeOrBuildergetLivenessProbeOrBuilder()

Periodic probe of container liveness. Container will be restarted if the probe fails.

.google.cloud.run.v2.Probe liveness_probe = 10;

Returns
Type Description
ProbeOrBuilder

getName()

publicStringgetName()

Name of the container specified as a DNS_LABEL (RFC 1123).

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

publicByteStringgetNameBytes()

Name of the container specified as a DNS_LABEL (RFC 1123).

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

publicParser<Container>getParserForType()
Returns
Type Description
Parser<Container>
Overrides

getPorts(int index)

publicContainerPortgetPorts(intindex)

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.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Parameter
Name Description
index int
Returns
Type Description
ContainerPort

getPortsCount()

publicintgetPortsCount()

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.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Returns
Type Description
int

getPortsList()

publicList<ContainerPort>getPortsList()

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.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Returns
Type Description
List<ContainerPort>

getPortsOrBuilder(int index)

publicContainerPortOrBuildergetPortsOrBuilder(intindex)

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.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Parameter
Name Description
index int
Returns
Type Description
ContainerPortOrBuilder

getPortsOrBuilderList()

publicList<?extendsContainerPortOrBuilder>getPortsOrBuilderList()

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.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Returns
Type Description
List<? extends com.google.cloud.run.v2.ContainerPortOrBuilder>

getResources()

publicResourceRequirementsgetResources()

Compute Resource requirements by this container.

.google.cloud.run.v2.ResourceRequirements resources = 6;

Returns
Type Description
ResourceRequirements

The resources.

getResourcesOrBuilder()

publicResourceRequirementsOrBuildergetResourcesOrBuilder()

Compute Resource requirements by this container.

.google.cloud.run.v2.ResourceRequirements resources = 6;

Returns
Type Description
ResourceRequirementsOrBuilder

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getStartupProbe()

publicProbegetStartupProbe()

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.

.google.cloud.run.v2.Probe startup_probe = 11;

Returns
Type Description
Probe

The startupProbe.

getStartupProbeOrBuilder()

publicProbeOrBuildergetStartupProbeOrBuilder()

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.

.google.cloud.run.v2.Probe startup_probe = 11;

Returns
Type Description
ProbeOrBuilder

getVolumeMounts(int index)

publicVolumeMountgetVolumeMounts(intindex)

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Parameter
Name Description
index int
Returns
Type Description
VolumeMount

getVolumeMountsCount()

publicintgetVolumeMountsCount()

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Returns
Type Description
int

getVolumeMountsList()

publicList<VolumeMount>getVolumeMountsList()

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Returns
Type Description
List<VolumeMount>

getVolumeMountsOrBuilder(int index)

publicVolumeMountOrBuildergetVolumeMountsOrBuilder(intindex)

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Parameter
Name Description
index int
Returns
Type Description
VolumeMountOrBuilder

getVolumeMountsOrBuilderList()

publicList<?extendsVolumeMountOrBuilder>getVolumeMountsOrBuilderList()

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Returns
Type Description
List<? extends com.google.cloud.run.v2.VolumeMountOrBuilder>

getWorkingDir()

publicStringgetWorkingDir()

Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.

string working_dir = 9;

Returns
Type Description
String

The workingDir.

getWorkingDirBytes()

publicByteStringgetWorkingDirBytes()

Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.

string working_dir = 9;

Returns
Type Description
ByteString

The bytes for workingDir.

hasBuildInfo()

publicbooleanhasBuildInfo()

Output only. The build info of the container image.

.google.cloud.run.v2.BuildInfo build_info = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the buildInfo field is set.

hasLivenessProbe()

publicbooleanhasLivenessProbe()

Periodic probe of container liveness. Container will be restarted if the probe fails.

.google.cloud.run.v2.Probe liveness_probe = 10;

Returns
Type Description
boolean

Whether the livenessProbe field is set.

hasResources()

publicbooleanhasResources()

Compute Resource requirements by this container.

.google.cloud.run.v2.ResourceRequirements resources = 6;

Returns
Type Description
boolean

Whether the resources field is set.

hasStartupProbe()

publicbooleanhasStartupProbe()

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.

.google.cloud.run.v2.Probe startup_probe = 11;

Returns
Type Description
boolean

Whether the startupProbe field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicContainer.BuildernewBuilderForType()
Returns
Type Description
Container.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedContainer.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Container.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicContainer.BuildertoBuilder()
Returns
Type Description
Container.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.