resources.containers.containerdefinitie
Een containerresource verwijst naar een containerinstallatiekopieën.
containers:
- container: string # Required as first property. Alias of the container.
image: string # Required. Container image tag.
type: string # Type of the registry like ACR or GCR.
trigger: trigger | none | true # Specify none to disable, true to trigger on all image tags, or use the full syntax as described in 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.
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.
externals: boolean # Mount the externals directory as readonly.
tools: boolean # Mount the tools directory as readonly.
tasks: boolean # Mount the tasks directory as readonly.
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.
localImage: boolean # When true, uses a locally tagged image instead of using docker pull to get the image. The default is false.
containers:
- container: string # Required as first property. Alias of the container.
type: string # Type of the registry like ACR or GCR.
endpoint: string # ID of the service endpoint connecting to a private container registry.
trigger: trigger | none | true # Specify none to disable, true to trigger on all image tags, or use the full syntax as described in 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.
localImage: boolean # When true, uses a locally tagged image instead of using docker pull to get the image. The default is false.
Definities die naar deze definitie verwijzen: resources.containers
Eigenschappen
container
tekenreeks. Vereist als eerste eigenschap.
-id voor de container. Acceptabele waarden: [-_A-Za-z0-9]*.
image
tekenreeks. Verplicht.
tag containerinstallatiekopieën.
type
tekenreeks.
Type van het register, zoals ACR of GCR.
trigger
resources.containers.container.trigger.
Geef niets op om uit te schakelen, waar om te activeren voor alle afbeeldingstags of gebruik de volledige syntaxis, zoals beschreven in de volgende voorbeelden.
endpoint
tekenreeks.
id van het service-eindpunt dat verbinding maakt met een privécontainerregister.
sjabloonexpressies worden ondersteund.
endpoint
tekenreeks.
id van het service-eindpunt dat verbinding maakt met een privécontainerregister.
env
tekenreekswoordenlijst.
variabelen die moeten worden toegewezen aan de omgeving van de container.
mapDockerSocket
booleaanse.
Stel deze vlag in op false om af te dwingen dat de agent het volume /var/run/docker.sock niet instelt op containertaken.
options
tekenreeks.
Opties om door te geven aan de containerhost.
sjabloonexpressies worden ondersteund.
options
tekenreeks.
Opties om door te geven aan de containerhost.
ports
lijst met tekenreeksen.
poorten om weer te geven op de container.
sjabloonexpressies worden ondersteund.
ports
lijst met tekenreeksen.
poorten om weer te geven op de container.
volumes
lijst met tekenreeksen.
volumes die moeten worden gekoppeld aan de container.
sjabloonexpressies worden ondersteund.
volumes
lijst met tekenreeksen.
volumes die moeten worden gekoppeld aan de container.
mountReadOnly
mountReadOnly.
volumes om alleen-lezen te koppelen, is de standaardwaarde onwaar.
azureSubscription
tekenreeks.
Azure-abonnement (ARM-serviceverbinding) voor containerregister.
resourceGroup
tekenreeks.
resourcegroep voor uw ACR.
registry
tekenreeks.
Registry voor containerinstallatiekopieën.
repository
tekenreeks.
naam van de opslagplaats voor containerinstallatiekopieën in ACR.
localImage
booleaanse.
Wanneer waar, gebruikt u een lokaal getagde installatiekopie in plaats van docker pull te gebruiken om de installatiekopie op te halen. De standaardwaarde is onwaar.
Deze eigenschap is alleen nuttig voor zelf-hostende agents waar de installatiekopie al aanwezig is op de agentcomputer.
Opmerkingen
Containertaken kunt u uw hulpprogramma's en afhankelijkheden in een container isoleren.
De agent start een exemplaar van uw opgegeven container en voert vervolgens stappen erin uit.
Met het trefwoord container
kunt u uw containerinstallatiekopieën opgeven.
Service-containers naast een taak worden uitgevoerd om verschillende afhankelijkheden zoals databases te bieden.
sjabloonexpressies worden ondersteund voor endpoint
, volumes
, ports
en options
eigenschappen van een containerresource in een YAML-pijplijn.
Voorbeelden
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