# Cloud Run V2 API - Class Google::Cloud::Run::V2::Container (v0.29.0)

0.29.0 (latest) 0.28.1 0.27.0 0.26.0 0.25.0 0.24.1 0.23.0 0.22.1 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.1 0.15.0 0.14.0 0.13.2 0.12.0 0.11.0 0.10.1 0.9.1 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.1 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Run V2 API class Google::Cloud::Run::V2::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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #args

    def args() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

### #args=

    def args=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
**Returns**

- (::Array\<::String\>) --- Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

### #base_image_uri

    def base_image_uri() -> ::String

**Returns**

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

### #base_image_uri=

    def base_image_uri=(value) -> ::String

**Parameter**

- **value** (::String) --- Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.
**Returns**

- (::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

    def build_info() -> ::Google::Cloud::Run::V2::BuildInfo

**Returns**

- ([::Google::Cloud::Run::V2::BuildInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-BuildInfo)) --- Output only. The build info of the container image.

### #command

    def command() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

### #command=

    def command=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.
**Returns**

- (::Array\<::String\>) --- Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

### #depends_on

    def depends_on() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Names of the containers that must start before this container.

### #depends_on=

    def depends_on=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Names of the containers that must start before this container.
**Returns**

- (::Array\<::String\>) --- Names of the containers that must start before this container.

### #env

    def env() -> ::Array<::Google::Cloud::Run::V2::EnvVar>

**Returns**

- (::Array\<[::Google::Cloud::Run::V2::EnvVar](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-EnvVar)\>) --- List of environment variables to set in the container.

### #env=

    def env=(value) -> ::Array<::Google::Cloud::Run::V2::EnvVar>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Run::V2::EnvVar](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-EnvVar)\>) --- List of environment variables to set in the container.
**Returns**

- (::Array\<[::Google::Cloud::Run::V2::EnvVar](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-EnvVar)\>) --- List of environment variables to set in the container.

### #image

    def image() -> ::String

**Returns**

- (::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.

### #image=

    def image=(value) -> ::String

**Parameter**

- **value** (::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.
**Returns**

- (::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.

### #liveness_probe

    def liveness_probe() -> ::Google::Cloud::Run::V2::Probe

**Returns**

- ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Probe)) --- Periodic probe of container liveness. Container will be restarted if the probe fails.

### #liveness_probe=

    def liveness_probe=(value) -> ::Google::Cloud::Run::V2::Probe

**Parameter**

- **value** ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Probe)) --- Periodic probe of container liveness. Container will be restarted if the probe fails.
**Returns**

- ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Probe)) --- Periodic probe of container liveness. Container will be restarted if the probe fails.

### #name

    def name() -> ::String

**Returns**

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

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Name of the container specified as a DNS_LABEL (RFC 1123).
**Returns**

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

### #ports

    def ports() -> ::Array<::Google::Cloud::Run::V2::ContainerPort>

**Returns**

- (::Array\<[::Google::Cloud::Run::V2::ContainerPort](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-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.

### #ports=

    def ports=(value) -> ::Array<::Google::Cloud::Run::V2::ContainerPort>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Run::V2::ContainerPort](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-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.
**Returns**

- (::Array\<[::Google::Cloud::Run::V2::ContainerPort](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-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.

### #readiness_probe

    def readiness_probe() -> ::Google::Cloud::Run::V2::Probe

**Returns**

- ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Probe)) --- Readiness probe to be used for health checks.

### #readiness_probe=

    def readiness_probe=(value) -> ::Google::Cloud::Run::V2::Probe

**Parameter**

- **value** ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Probe)) --- Readiness probe to be used for health checks.
**Returns**

- ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Probe)) --- Readiness probe to be used for health checks.

### #resources

    def resources() -> ::Google::Cloud::Run::V2::ResourceRequirements

**Returns**

- ([::Google::Cloud::Run::V2::ResourceRequirements](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-ResourceRequirements)) --- Compute Resource requirements by this container.

### #resources=

    def resources=(value) -> ::Google::Cloud::Run::V2::ResourceRequirements

**Parameter**

- **value** ([::Google::Cloud::Run::V2::ResourceRequirements](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-ResourceRequirements)) --- Compute Resource requirements by this container.
**Returns**

- ([::Google::Cloud::Run::V2::ResourceRequirements](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-ResourceRequirements)) --- Compute Resource requirements by this container.

### #source_code

    def source_code() -> ::Google::Cloud::Run::V2::SourceCode

**Returns**

- ([::Google::Cloud::Run::V2::SourceCode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-SourceCode)) --- Optional. Location of the source.

### #source_code=

    def source_code=(value) -> ::Google::Cloud::Run::V2::SourceCode

**Parameter**

- **value** ([::Google::Cloud::Run::V2::SourceCode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-SourceCode)) --- Optional. Location of the source.
**Returns**

- ([::Google::Cloud::Run::V2::SourceCode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-SourceCode)) --- Optional. Location of the source.

### #startup_probe

    def startup_probe() -> ::Google::Cloud::Run::V2::Probe

**Returns**

- ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-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.

### #startup_probe=

    def startup_probe=(value) -> ::Google::Cloud::Run::V2::Probe

**Parameter**

- **value** ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-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.
**Returns**

- ([::Google::Cloud::Run::V2::Probe](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-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.

### #volume_mounts

    def volume_mounts() -> ::Array<::Google::Cloud::Run::V2::VolumeMount>

**Returns**

- (::Array\<[::Google::Cloud::Run::V2::VolumeMount](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-VolumeMount)\>) --- Volume to mount into the container's filesystem.

### #volume_mounts=

    def volume_mounts=(value) -> ::Array<::Google::Cloud::Run::V2::VolumeMount>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Run::V2::VolumeMount](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-VolumeMount)\>) --- Volume to mount into the container's filesystem.
**Returns**

- (::Array\<[::Google::Cloud::Run::V2::VolumeMount](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-VolumeMount)\>) --- Volume to mount into the container's filesystem.

### #working_dir

    def working_dir() -> ::String

**Returns**

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

### #working_dir=

    def working_dir=(value) -> ::String

**Parameter**

- **value** (::String) --- Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.
**Returns**

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