resources.containers.container definition
A container resource references a container image.
containers:
- container: string # Required as first property. ID for the container. ([-_A-Za-z0-9]*)
endpoint: string # ID of the service endpoint connecting to a private container registry.
azureSubscription: string # Azure subscription (ARM service connection) for container registry.
resourceGroup: string # Resource group for your ACR.
registry: string # Registry for container images.
repository: string # Name of the container image repository in ACR.
Properties that use this definition: resources.containers
Properties
container
string
Required as first parameter. ID for the container. Acceptable values: [_A-Za-z0-9]*endpoint
string
ID of the service endpoint connecting to a private container registry.azureSubscription
string
Azure subscription (ARM service connection) for container registry.resourceGroup
string
Resource group for your ACR.registry
string
Registry for container images.repository
string
Name of the container image repository in ACR.containers:
- container: string # Required as first property. ID for the container. ([-_A-Za-z0-9]*)
endpoint: string # ID of the service endpoint connecting to a private container registry.
azureSubscription: string # Azure subscription (ARM service connection) for container registry.
resourceGroup: string # Resource group for your ACR.
registry: string # Registry for container images.
repository: string # Name of the container image repository in ACR.
Properties that use this definition: resources.containers
Properties
container
string
Required as first parameter. ID for the container. Acceptable values: [_A-Za-z0-9]*endpoint
string
ID of the service endpoint connecting to a private container registry.azureSubscription
string
Azure subscription (ARM service connection) for container registry.resourceGroup
string
Resource group for your ACR.registry
string
Registry for container images.repository
string
Name of the container image repository in ACR.containers:
- container: string # Required as first property. ID for the container. ([-_A-Za-z0-9]*)
type: string # Type of the registry like ACR or GCR.
endpoint: string # ID of the service endpoint connecting to a private container registry.
trigger: # none to disable, true to trigger on all image tags, or full syntax (see the following examples).
azureSubscription: string # Azure subscription (ARM service connection) for container registry.
resourceGroup: string # Resource group for your ACR.
registry: string # Registry for container images.
repository: string # Name of the container image repository in ACR.
Properties that use this definition: resources.containers
Properties
container
string
Required as first parameter. ID for the container. Acceptable values: [_A-Za-z0-9]*type
string
endpoint
string
ID of the service endpoint connecting to a private container registry.trigger
string or trigger
azureSubscription
string
Azure subscription (ARM service connection) for container registry.resourceGroup
string
Resource group for your ACR.registry
string
Registry for container images.repository
string
Name of the container image repository in ACR.containers:
- container: string # Required as first property. ID for the container. ([-_A-Za-z0-9]*)
image: string # Required. Container image tag.
type: string # Type of the registry like ACR or GCR.
trigger: # none to disable, true to trigger on all image tags, or full syntax (see the following examples).
endpoint: string # ID of the service endpoint connecting to a private container registry.
env: # Variables to map into the container's environment
string: string # Name/value pairs.
mapDockerSocket: boolean # Set this flag to false to force the agent not to setup the /var/run/docker.sock volume on container jobs. (false,n,no,off,on,true,y,yes)
options: string # Options to pass into container host.
ports: [ string ] # Ports to expose on the container.
volumes: [ string ] # Volumes to mount on the container.
mountReadOnly: # Volumes to mount read-only, the default is all false.
work: boolean # Mount the work directory as readonly. (false,n,no,off,on,true,y,yes)
externals: boolean # Mount the externals directory as readonly. (false,n,no,off,on,true,y,yes)
tools: boolean # Mount the tools directory as readonly. (false,n,no,off,on,true,y,yes)
tasks: boolean # Mount the tasks directory as readonly. (false,n,no,off,on,true,y,yes)
azureSubscription: string # Azure subscription (ARM service connection) for container registry.
resourceGroup: string # Resource group for your ACR.
registry: string # Registry for container images.
repository: string # Name of the container image repository in ACR.
Properties that use this definition: resources.containers
Properties
container
string
Required as first parameter. ID for the container. Acceptable values: [_A-Za-z0-9]*type
string
trigger
string or trigger
endpoint
string
ID of the service endpoint connecting to a private container registry.env
string name/value pairs
Variables to map into the container's environment.image
string
Required. Container image tag.mapDockerSocket
boolean
Set this flag to false to force the agent not to setup the /var/run/docker.sock volume on container jobs.options
string
Options to pass into container host.ports
string list
Ports to expose on the container.volumes
string list
Volumes to mount on the container.mountReadOnly
string/boolean pairs
Volumes to mount read-only, the default is all false.azureSubscription
string
Azure subscription (ARM service connection) for container registry.resourceGroup
string
Resource group for your ACR.registry
string
Registry for container images.repository
string
Name of the container image repository in ACR.containers:
- container: string # Required as first property. ID for the container. ([-_A-Za-z0-9]*)
image: string # Required. Container image tag.
type: string # Type of the registry like ACR or GCR.
trigger: # none to disable, true to trigger on all image tags, or full syntax (see the following examples).
endpoint: string # ID of the service endpoint connecting to a private container registry.
env: # Variables to map into the container's environment
string: string # Name/value pairs.
mapDockerSocket: boolean # Set this flag to false to force the agent not to setup the /var/run/docker.sock volume on container jobs. (false,n,no,off,on,true,y,yes)
options: string # Options to pass into container host.
ports: [ string ] # Ports to expose on the container.
volumes: [ string ] # Volumes to mount on the container.
mountReadOnly: # Volumes to mount read-only, the default is all false.
work: boolean # Mount the work directory as readonly. (false,n,no,off,on,true,y,yes)
externals: boolean # Mount the externals directory as readonly. (false,n,no,off,on,true,y,yes)
tools: boolean # Mount the tools directory as readonly. (false,n,no,off,on,true,y,yes)
tasks: boolean # Mount the tasks directory as readonly. (false,n,no,off,on,true,y,yes)
azureSubscription: string # Azure subscription (ARM service connection) for container registry.
resourceGroup: string # Resource group for your ACR.
registry: string # Registry for container images.
repository: string # Name of the container image repository in ACR.
Properties that use this definition: resources.containers
Properties
container
string
Required as first parameter. ID for the container. Acceptable values: [-_A-Za-z0-9]*type
string
trigger
string or trigger
endpoint
string
ID of the service endpoint connecting to a private container registry.env
string name/value pairs
Variables to map into the container's environment.image
string
Required. Container image tag.mapDockerSocket
boolean
Set this flag to false to force the agent not to setup the /var/run/docker.sock volume on container jobs.options
string
Options to pass into container host.ports
string list
Ports to expose on the container.volumes
string list
Volumes to mount on the container.mountReadOnly
string/boolean pairs
Volumes to mount read-only, the default is all false.azureSubscription
string
Azure subscription (ARM service connection) for container registry.resourceGroup
string
Resource group for your ACR.registry
string
Registry for container images.repository
string
Name of the container image repository in ACR.containers:
- container: string # Required as first property. ID for the container. ([-_A-Za-z0-9]*)
image: string # Required. Container image tag.
type: string # Type of the registry like ACR or GCR.
trigger: # none to disable, true to trigger on all image tags, or full syntax (see the following examples).
endpoint: string # ID of the service endpoint connecting to a private container registry.
env: # Variables to map into the container's environment
string: string # Name/value pairs.
mapDockerSocket: boolean # Set this flag to false to force the agent not to setup the /var/run/docker.sock volume on container jobs. (false,n,no,off,on,true,y,yes)
options: string # Options to pass into container host.
ports: [ string ] # Ports to expose on the container.
volumes: [ string ] # Volumes to mount on the container.
mountReadOnly: # Volumes to mount read-only, the default is all false.
work: boolean # Mount the work directory as readonly. (false,n,no,off,on,true,y,yes)
externals: boolean # Mount the externals directory as readonly. (false,n,no,off,on,true,y,yes)
tools: boolean # Mount the tools directory as readonly. (false,n,no,off,on,true,y,yes)
tasks: boolean # Mount the tasks directory as readonly. (false,n,no,off,on,true,y,yes)
azureSubscription: string # Azure subscription (ARM service connection) for container registry.
resourceGroup: string # Resource group for your ACR.
registry: string # Registry for container images.
repository: string # Name of the container image repository in ACR.
Properties that use this definition: resources.containers
Properties
container
string
Required as first parameter. ID for the container. Acceptable values: [-_A-Za-z0-9]*type
string
trigger
string or trigger
endpoint
string
ID of the service endpoint connecting to a private container registry.env
string name/value pairs
Variables to map into the container's environment.image
string
Required. Container image tag.mapDockerSocket
boolean
Set this flag to false to force the agent not to setup the /var/run/docker.sock volume on container jobs.options
string
Options to pass into container host.ports
string list
Ports to expose on the container.volumes
string list
Volumes to mount on the container.mountReadOnly
string/boolean pairs
Volumes to mount read-only, the default is all false.azureSubscription
string
Azure subscription (ARM service connection) for container registry.resourceGroup
string
Resource group for your ACR.registry
string
Registry for container images.repository
string
Name of the container image repository in ACR.Remarks
Container jobs let you isolate your tools and dependencies inside a container.
The agent launches an instance of your specified container then runs steps inside it.
The container keyword lets you specify your container images.
Service containers run alongside a job to provide various dependencies like databases.
Examples
resources:
containers:
- container: string # identifier (A-Z, a-z, 0-9, and underscore)
image: string # container image name
options: string # arguments to pass to container at startup
endpoint: string # reference to a service connection for the private registry
env: { string: string } # list of environment variables to add
ports: [ string ] # ports to expose on the container
volumes: [ string ] # volumes to mount on the container
mapDockerSocket: bool # whether to map in the Docker daemon socket; defaults to true
mountReadOnly: # volumes to mount read-only - all default to false
externals: boolean # components required to talk to the agent
tasks: boolean # tasks required by the job
tools: boolean # installable tools like Python and Ruby
work: boolean # the work directory
resources:
containers:
- container: string # identifier (A-Z, a-z, 0-9, and underscore)
image: string # container image name
options: string # arguments to pass to container at startup
endpoint: string # reference to a service connection for the private registry
env: { string: string } # list of environment variables to add
ports: [ string ] # ports to expose on the container
volumes: [ string ] # volumes to mount on the container
mapDockerSocket: bool # whether to map in the Docker daemon socket; defaults to true
resources:
containers:
- container: string # identifier (A-Z, a-z, 0-9, and underscore)
image: string # container image name
options: string # arguments to pass to container at startup
endpoint: string # reference to a service connection for the private registry
env: { string: string } # list of environment variables to add
ports: [ string ] # ports to expose on the container
volumes: [ string ] # volumes to mount on the container
resources:
containers:
- container: linux
image: ubuntu:16.04
- container: windows
image: myprivate.azurecr.io/windowsservercore:1803
endpoint: my_acr_connection
- container: my_service
image: my_service:tag
ports:
- 8080:80 # bind container port 80 to 8080 on the host machine
- 6379 # bind container port 6379 to a random available port on the host machine
volumes:
- /src/dir:/dst/dir # mount /src/dir on the host into /dst/dir in the container
See also
Feedback
Submit and view feedback for