Delen via


Docker@1 - Docker v1-taak

Docker-installatiekopieën bouwen, taggen, pushen of uitvoeren, of een Docker-opdracht uitvoeren. Gebruik deze taak met Docker of het Azure Container Registry.

Notitie

Docker@2 is een nieuwere versie van deze taak die de taak vereenvoudigt door invoer te verwijderen die als argumenten kunnen worden doorgegeven aan de opdracht.

Syntax

# Docker v1
# Build, tag, push, or run Docker images, or run a Docker command.
- task: Docker@1
  inputs:
  # Container Registry
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required when command != logout. Container registry type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry && command != logout. Docker registry service connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure container registry. 
  # Commands
    #addBaseImageData: true # boolean. Add base image metadata to image(s). Default: true.
    command: 'Build an image' # 'Build an image' | 'Tag image' | 'Push an image' | 'Run an image' | 'login' | 'logout'. Required. Command. Default: Build an image.
    #dockerFile: '**/Dockerfile' # string. Required when command = Build an image || command = build. Dockerfile. Default: **/Dockerfile.
    #arguments: # string. Optional. Use when command != login && command != logout. Arguments. 
    #pushMultipleImages: false # boolean. Optional. Use when command = Push an image || command = push. Push multiple images. Default: false.
    #tagMultipleImages: false # boolean. Optional. Use when command = Tag image || command = tag. Tag multiple images. Default: false.
    #imageName: '$(Build.Repository.Name):$(Build.BuildId)' # string. Required when command = Build an image || command = build || command = Run an image || command = run || pushMultipleImages = false || tagMultipleImages = false. Image name. Default: $(Build.Repository.Name):$(Build.BuildId).
    #imageNamesPath: # string. Required when tagMultipleImages = true || pushMultipleImages = true. Image names path. 
    #qualifyImageName: true # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push || command = Run an image || command = run. Qualify image name. Default: true.
    #qualifySourceImageName: false # boolean. Optional. Use when command = Tag image || command = tag. Qualify source image name. Default: false.
    #includeSourceTags: false # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag  || command = Push an image || command = push. Include source tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when command = Build an image || command = build. Include latest tag. Default: false.
    #addDefaultLabels: true # boolean. Optional. Use when addDefaultLabels = false. Add default labels. Default: true.
    #useDefaultContext: true # boolean. Optional. Use when command = Build an image || command = build. Use default build context. Default: true.
    #buildContext: # string. Optional. Use when useDefaultContext = false. Build context. 
    #imageDigestFile: # string. Optional. Use when command = Push an image || command = push. Image digest file. 
    #containerName: # string. Optional. Use when command = Run an image || command = run. Container name. 
    #ports: # string. Optional. Use when command = Run an image || command = run. Ports. 
    #volumes: # string. Optional. Use when command = Run an image || command = run. Volumes. 
    #envVars: # string. Optional. Use when command = Run an image || command = run. Environment variables. 
    #workingDirectory: # string. Optional. Use when command = Run an image || command = run. Working directory. 
    #entrypointOverride: # string. Optional. Use when command = Run an image || command = run. Entry point override. 
    #containerCommand: # string. Optional. Use when command = Run an image || command = run. Container command. 
    #runInBackground: true # boolean. Optional. Use when command = Run an image || command = run. Run in background. Default: true.
    restartPolicy: 'no' # 'no' | 'onFailure' | 'always' | 'unlessStopped'. Required when runInBackground = true. Restart policy. Default: no.
    #maxRestartRetries: # string. Optional. Use when runInBackground = true && restartPolicy = onFailure. Maximum restart retries. 
  # Advanced Options
    #dockerHostEndpoint: # string. Optional. Use when command != login && command != logout. Docker host service connection. 
    #enforceDockerNamingConvention: true # boolean. Optional. Use when command != login && command != logout. Force image name to follow Docker naming convention. Default: true.
    #memoryLimit: # string. Optional. Use when command != login && command != logout. Memory limit.
# Docker v1
# Build, tag, push, or run Docker images, or run a Docker command.
- task: Docker@1
  inputs:
  # Container Registry
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required when command != logout. Container registry type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry && command != logout. Docker registry service connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure container registry. 
  # Commands
    command: 'Build an image' # 'Build an image' | 'Tag image' | 'Push an image' | 'Run an image' | 'login' | 'logout'. Required. Command. Default: Build an image.
    #dockerFile: '**/Dockerfile' # string. Required when command = Build an image || command = build. Dockerfile. Default: **/Dockerfile.
    #arguments: # string. Optional. Use when command != login && command != logout. Arguments. 
    #pushMultipleImages: false # boolean. Optional. Use when command = Push an image || command = push. Push multiple images. Default: false.
    #tagMultipleImages: false # boolean. Optional. Use when command = Tag image || command = tag. Tag multiple images. Default: false.
    #imageName: '$(Build.Repository.Name):$(Build.BuildId)' # string. Required when command = Build an image || command = build || command = Run an image || command = run || pushMultipleImages = false || tagMultipleImages = false. Image name. Default: $(Build.Repository.Name):$(Build.BuildId).
    #imageNamesPath: # string. Required when tagMultipleImages = true || pushMultipleImages = true. Image names path. 
    #qualifyImageName: true # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push || command = Run an image || command = run. Qualify image name. Default: true.
    #qualifySourceImageName: false # boolean. Optional. Use when command = Tag image || command = tag. Qualify source image name. Default: false.
    #includeSourceTags: false # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag  || command = Push an image || command = push. Include source tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when command = Build an image || command = build. Include latest tag. Default: false.
    #addDefaultLabels: true # boolean. Optional. Use when addDefaultLabels = false. Add default labels. Default: true.
    #useDefaultContext: true # boolean. Optional. Use when command = Build an image || command = build. Use default build context. Default: true.
    #buildContext: # string. Optional. Use when useDefaultContext = false. Build context. 
    #imageDigestFile: # string. Optional. Use when command = Push an image || command = push. Image digest file. 
    #containerName: # string. Optional. Use when command = Run an image || command = run. Container name. 
    #ports: # string. Optional. Use when command = Run an image || command = run. Ports. 
    #volumes: # string. Optional. Use when command = Run an image || command = run. Volumes. 
    #envVars: # string. Optional. Use when command = Run an image || command = run. Environment variables. 
    #workingDirectory: # string. Optional. Use when command = Run an image || command = run. Working directory. 
    #entrypointOverride: # string. Optional. Use when command = Run an image || command = run. Entry point override. 
    #containerCommand: # string. Optional. Use when command = Run an image || command = run. Container command. 
    #runInBackground: true # boolean. Optional. Use when command = Run an image || command = run. Run in background. Default: true.
    restartPolicy: 'no' # 'no' | 'onFailure' | 'always' | 'unlessStopped'. Required when runInBackground = true. Restart policy. Default: no.
    #maxRestartRetries: # string. Optional. Use when runInBackground = true && restartPolicy = onFailure. Maximum restart retries. 
  # Advanced Options
    #dockerHostEndpoint: # string. Optional. Use when command != login && command != logout. Docker host service connection. 
    #enforceDockerNamingConvention: true # boolean. Optional. Use when command != login && command != logout. Force image name to follow Docker naming convention. Default: true.
    #memoryLimit: # string. Optional. Use when command != login && command != logout. Memory limit.
# Docker v1
# Build, tag, push, or run Docker images, or run a Docker command.
- task: Docker@1
  inputs:
  # Container Registry
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required when command != logout. Container registry type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry && command != logout. Docker registry service connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure container registry. 
  # Commands
    command: 'Build an image' # 'Build an image' | 'Tag image' | 'Push an image' | 'Run an image' | 'login' | 'logout'. Required. Command. Default: Build an image.
    #dockerFile: '**/Dockerfile' # string. Required when command = Build an image || command = build. Dockerfile. Default: **/Dockerfile.
    #arguments: # string. Optional. Use when command != login && command != logout. Arguments. 
    #pushMultipleImages: false # boolean. Optional. Use when command = Push an image || command = push. Push multiple images. Default: false.
    #tagMultipleImages: false # boolean. Optional. Use when command = Tag image || command = tag. Tag multiple images. Default: false.
    #imageName: '$(Build.Repository.Name):$(Build.BuildId)' # string. Required when command = Build an image || command = build || command = Run an image || command = run || pushMultipleImages = false || tagMultipleImages = false. Image name. Default: $(Build.Repository.Name):$(Build.BuildId).
    #imageNamesPath: # string. Required when tagMultipleImages = true || pushMultipleImages = true. Image names path. 
    #qualifyImageName: true # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push || command = Run an image || command = run. Qualify image name. Default: true.
    #includeSourceTags: false # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag  || command = Push an image || command = push. Include source tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when command = Build an image || command = build. Include latest tag. Default: false.
    #addDefaultLabels: true # boolean. Optional. Use when addDefaultLabels = false. Add default labels. Default: true.
    #useDefaultContext: true # boolean. Optional. Use when command = Build an image || command = build. Use default build context. Default: true.
    #buildContext: # string. Optional. Use when useDefaultContext = false. Build context. 
    #imageDigestFile: # string. Optional. Use when command = Push an image || command = push. Image digest file. 
    #containerName: # string. Optional. Use when command = Run an image || command = run. Container name. 
    #ports: # string. Optional. Use when command = Run an image || command = run. Ports. 
    #volumes: # string. Optional. Use when command = Run an image || command = run. Volumes. 
    #envVars: # string. Optional. Use when command = Run an image || command = run. Environment variables. 
    #workingDirectory: # string. Optional. Use when command = Run an image || command = run. Working directory. 
    #entrypointOverride: # string. Optional. Use when command = Run an image || command = run. Entry point override. 
    #containerCommand: # string. Optional. Use when command = Run an image || command = run. Container command. 
    #runInBackground: true # boolean. Optional. Use when command = Run an image || command = run. Run in background. Default: true.
    restartPolicy: 'no' # 'no' | 'onFailure' | 'always' | 'unlessStopped'. Required when runInBackground = true. Restart policy. Default: no.
    #maxRestartRetries: # string. Optional. Use when runInBackground = true && restartPolicy = onFailure. Maximum restart retries. 
  # Advanced Options
    #dockerHostEndpoint: # string. Optional. Use when command != login && command != logout. Docker host service connection. 
    #enforceDockerNamingConvention: true # boolean. Optional. Use when command != login && command != logout. Force image name to follow Docker naming convention. Default: true.
    #memoryLimit: # string. Optional. Use when command != login && command != logout. Memory limit.
# Docker v1
# Build, tag, push, or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.
- task: Docker@1
  inputs:
  # Container Registry
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required when command != logout. Container registry type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry && command != logout. Docker registry service connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry && command != logout. Azure container registry. 
  # Commands
    command: 'Build an image' # 'Build an image' | 'Tag image' | 'Push an image' | 'Run an image' | 'login' | 'logout'. Required. Command. Default: Build an image.
    #dockerFile: '**/Dockerfile' # string. Required when command = Build an image || command = build. Dockerfile. Default: **/Dockerfile.
    #arguments: # string. Optional. Use when command != Run an image && command != run && command != login && command != logout. Arguments. 
    #useDefaultContext: true # boolean. Optional. Use when command = Build an image || command = build. Use default build context. Default: true.
    #buildContext: # string. Optional. Use when useDefaultContext = false. Build context. 
    #pushMultipleImages: false # boolean. Optional. Use when command = Push an image || command = push. Push multiple images. Default: false.
    #tagMultipleImages: false # boolean. Optional. Use when command = Tag image || command = tag. Tag multiple images. Default: false.
    #imageName: '$(Build.Repository.Name):$(Build.BuildId)' # string. Required when command = Build an image || command = build || command = Run an image || command = run || pushMultipleImages = false || tagMultipleImages = false. Image name. Default: $(Build.Repository.Name):$(Build.BuildId).
    #imageNamesPath: # string. Required when tagMultipleImages = true || pushMultipleImages = true. Image names path. 
    #qualifyImageName: true # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push || command = Run an image || command = run. Qualify image name. Default: true.
    #includeSourceTags: false # boolean. Optional. Use when command = Build an image || command = build || command = Tag image || command = tag  || command = Push an image || command = push. Include source tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when command = Build an image || command = build. Include latest tag. Default: false.
    #addDefaultLabels: true # boolean. Optional. Use when command = Build an image || command = build. Add default labels. Default: true.
    #imageDigestFile: # string. Optional. Use when command = Push an image || command = push. Image digest file. 
    #containerName: # string. Optional. Use when command = Run an image || command = run. Container name. 
    #ports: # string. Optional. Use when command = Run an image || command = run. Ports. 
    #volumes: # string. Optional. Use when command = Run an image || command = run. Volumes. 
    #envVars: # string. Optional. Use when command = Run an image || command = run. Environment variables. 
    #workingDirectory: # string. Optional. Use when command = Run an image || command = run. Working directory. 
    #entrypointOverride: # string. Optional. Use when command = Run an image || command = run. Entry point override. 
    #containerCommand: # string. Optional. Use when command = Run an image || command = run. Command. 
    #runInBackground: true # boolean. Optional. Use when command = Run an image || command = run. Run in background. Default: true.
    restartPolicy: 'no' # 'no' | 'onFailure' | 'always' | 'unlessStopped'. Required when runInBackground = true. Restart policy. Default: no.
    #maxRestartRetries: # string. Optional. Use when runInBackground = true && restartPolicy = onFailure. Maximum restart retries. 
  # Advanced Options
    #dockerHostEndpoint: # string. Optional. Use when command != login && command != logout. Docker host service connection. 
    #enforceDockerNamingConvention: true # boolean. Optional. Use when command != login && command != logout. Force image name to follow Docker naming convention. Default: true.
    #memoryLimit: # string. Optional. Use when command != login && command != logout. Memory limit.

Invoerwaarden

containerregistrytype - Type containerregister
string. Vereist wanneer command != logout. Toegestane waarden: Azure Container Registry, Container Registry. Standaardwaarde: Azure Container Registry.

Hiermee geeft u de Azure Container Registry verbinding maken met behulp van een Azure-serviceverbinding. Selecteer een Azure Container Registry om verbinding te maken met een Docker Hub of een ander privécontainerregister.


addBaseImageData - Metagegevens van basisinstallatiekopieën toevoegen aan installatiekopieën
boolean. Standaardwaarde: true.

De standaardwaarde voegt basisafbeeldingsgegevens toe, zoals de naam van de basisinstallatiekopieën en digest, om te helpen bij de traceerbaarheid. U kunt zich afmelden voor dit standaardgedrag door deze waarde in te stellen op false.


dockerRegistryEndpoint - Verbinding met docker-registerservice
string. Optioneel. Gebruik wanneer containerregistrytype = Container Registry && command != logout.

Hiermee geeft u een Docker-registerserviceverbinding op. Vereist voor opdrachten die worden geverifieerd met behulp van een register.


azureSubscriptionEndpoint - Azure-abonnement
string. Optioneel. Gebruik wanneer containerregistrytype = Azure Container Registry && command != logout.

Hiermee geeft u een Azure-abonnement op.


azureContainerRegistry - Azure Container Registry
string. Optioneel. Gebruik wanneer containerregistrytype = Azure Container Registry && command != logout.

Hiermee geeft u een Azure Container Registry in het geselecteerde Azure-abonnement. De containerinstallatiekopieën worden gebouwd en naar dit containerregister gepusht.


command - Opdracht
string. Vereist. Toegestane waarden: Build an image (build), Tag image (tag), Push an image (push), Run an image (uitvoeren), login, logout. Standaardwaarde: Build an image.

Hiermee geeft u de docker opdracht uit te voeren.


dockerFile - Dockerfile
string. Vereist wanneer command = Build an image || command = build. Standaardwaarde: **/Dockerfile.

Hiermee geeft u het pad naar het Docker-bestand. De taak gebruikt het eerste docker-bestand dat wordt gevonden om de installatiekopieën te bouwen.


arguments - Argumenten
string. Optioneel. Gebruik wanneer command != login && command != logout.

Hiermee geeft u aanvullende argumenten door aan de Docker-client. Als u de waarde buildAndPush in de opdrachtparameter gebruikt, wordt de eigenschap argumenten genegeerd.


arguments - Argumenten
string. Optioneel. Gebruik wanneer command != Run an image && command != run && command != login && command != logout.

Hiermee geeft u aanvullende argumenten door aan de Docker-client. Als u de waarde buildAndPush in de opdrachtparameter gebruikt, wordt de eigenschap argumenten genegeerd.


pushMultipleImages - Meerdere installatiekopieën pushen
boolean. Optioneel. Gebruik wanneer command = Push an image || command = push. Standaardwaarde: false.

Hiermee geeft u een lijst op in een tekstbestand met Docker-installatiekopieën die moeten worden gepusht. Geef elke afbeeldingsnaam in de indeling Imagename1:tag1 op een afzonderlijke regel weer. Als u bijvoorbeeld Imagename2de naam van een installatiekopieën zonder tags weer geeft, worden alle tags in de Imagename2 container gepusht.


tagMultipleImages - Meerdere afbeeldingen taggen
boolean. Optioneel. Gebruik wanneer command = Tag image || command = tag. Standaardwaarde: false.

Hiermee geeft u een lijst met meerdere afbeeldingstags en Docker-installatiekopieën te taggen in een tekstbestand. Geef elke afbeeldingsnaam in de indeling Imagename1:tag1 op een afzonderlijke regel weer. Afbeeldingen die zonder tag worden weergegeven, Imagename2 worden standaard gelabeld als meest recente .


imageName - Naam van afbeelding
string. Vereist wanneer command = Build an image || command = build || command = Run an image || command = run || pushMultipleImages = false || tagMultipleImages = false. Standaardwaarde: $(Build.Repository.Name):$(Build.BuildId).

Hiermee geeft u de naam op van de Docker-installatiekopieën die moeten worden gebouwd, gepusht of uitgevoerd.


imageNamesPath - Pad naar namen van installatiekopieën
string. Vereist wanneer tagMultipleImages = true || pushMultipleImages = true.

Hiermee geeft u het pad naar een tekstbestand met de namen van de Docker-installatiekopieën te taggen of te pushen. Vermeld elke afbeeldingsnaam op een afzonderlijke regel.


qualifyImageName - Naam van installatiekopieën kwalificeren
boolean. Optioneel. Gebruik wanneer command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push || command = Run an image || command = run. Standaardwaarde: true.

Hiermee geeft u de naam van een gekwalificeerde installatiekopie op met de hostnaam van de Docker-registerserviceverbinding.


qualifySourceImageName - Naam van broninstallatiekopieën kwalificeren
boolean. Optioneel. Gebruik wanneer command = Tag image || command = tag. Standaardwaarde: false.

Hiermee geeft u de naam van een gekwalificeerde installatiekopie op met de hostnaam van de Docker-registerserviceverbinding.


includeSourceTags - Brontags opnemen
boolean. Optioneel. Gebruik wanneer command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push. Standaardwaarde: false.

Hiermee geeft u Git-tags op die moeten worden opgenomen bij het bouwen of pushen van de Docker-installatiekopieën.


includeLatestTag - Meest recente tag opnemen
boolean. Optioneel. Gebruik wanneer command = Build an image || command = build. Standaardwaarde: false.

Hiermee geeft u op of de meest recente tag moet worden gebruikt bij het bouwen van de Docker-installatiekopieën.


addDefaultLabels - Standaardlabels toevoegen
boolean. Optioneel. Gebruik wanneer addDefaultLabels = false. Standaardwaarde: true.

Hiermee geeft u op of CI/CD-metagegevens moeten worden toegevoegd aan de containerinstallatiekopieën met behulp van Docker-labels, zoals informatie over opslagplaatsen, doorvoeren, bouwen en vrijgeven.


addDefaultLabels - Standaardlabels toevoegen
boolean. Optioneel. Gebruik wanneer command = Build an image || command = build. Standaardwaarde: true.

Hiermee geeft u op of CI/CD-metagegevens moeten worden toegevoegd aan de containerinstallatiekopieën met behulp van Docker-labels, zoals informatie over opslagplaatsen, doorvoeren, bouwen en vrijgeven.


useDefaultContext - Standaardcontext voor bouwen gebruiken
boolean. Optioneel. Gebruik wanneer command = Build an image || command = build. Standaardwaarde: true.

Hiermee geeft u het toevoegen of verwijderen van buildcontext aan de map die het Docker-bestand bevat.


buildContext - Context bouwen
string. Optioneel. Gebruik wanneer useDefaultContext = false.

Hiermee geeft u het pad naar de buildcontext op.


imageDigestFile - Samenvattingsbestand van installatiekopieën
string. Optioneel. Gebruik wanneer command = Push an image || command = push.

Hiermee geeft u het pad op naar een bestand dat is gemaakt en gevuld met de volledige samenvatting van de opslagplaats voor installatiekopieën van de Docker-installatiekopieën die is gepusht.


containerName - Containernaam
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u de naam van de Docker-container die moet worden uitgevoerd.


ports - Poorten
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u de poorten in de Docker-container te publiceren naar de host. Vermeld elke host-port:container-port binding op een afzonderlijke regel.


volumes - Volumes
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u de volumes te koppelen vanaf de host. Vermeld elk op host-dir:container-dir een afzonderlijke regel.


envVars - Omgevingsvariabelen
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u omgevingsvariabelen voor de Docker-container op. Vermeld elk name=value paar op een afzonderlijke regel.


workingDirectory - Werkmap
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u de werkmap voor de Docker-container.


entrypointOverride - Onderdrukking van invoerpunt
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u op of het standaardinvoerpunt voor de Docker-container moet worden overschreven.


containerCommand - Containeropdracht
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u een Docker-opdracht uitvoeren. De opdracht docker run maakt eerst een beschrijfbare containerlaag over de opgegeven installatiekopieën en start deze vervolgens met behulp van de opgegeven uitvoeringsopdracht. Als de afbeelding bijvoorbeeld een eenvoudige Python Flask-webtoepassing bevat, kunt u opgeven python app.py om de webtoepassing te starten.


containerCommand - Opdracht
string. Optioneel. Gebruik wanneer command = Run an image || command = run.

Hiermee geeft u een Docker-opdracht uitvoeren. De opdracht docker run maakt eerst een beschrijfbare containerlaag over de opgegeven installatiekopieën en start deze vervolgens met behulp van de opgegeven uitvoeringsopdracht. Als de afbeelding bijvoorbeeld een eenvoudige Python Flask-webtoepassing bevat, kunt u opgeven python app.py om de webtoepassing te starten.


runInBackground - Uitvoeren op de achtergrond
boolean. Optioneel. Gebruik wanneer command = Run an image || command = run. Standaardwaarde: true.

Hiermee geeft u op of de Docker-container op de achtergrond moet worden uitgevoerd.


restartPolicy - Beleid voor opnieuw opstarten
string. Vereist wanneer runInBackground = true. Toegestane waarden: no, onFailure (Bij fout), always, unlessStopped (tenzij gestopt). Standaardwaarde: no.

Hiermee geeft u op wanneer een beleid voor opnieuw opstarten moet worden uitgevoerd.


maxRestartRetries - Maximum aantal nieuwe pogingen om opnieuw te starten
string. Optioneel. Gebruik wanneer runInBackground = true && restartPolicy = onFailure.

Hiermee geeft u het maximum aantal pogingen voor het opnieuw opstarten van de Docker-daemon op.


dockerHostEndpoint - Verbinding met Docker-hostservice
string. Optioneel. Gebruik wanneer command != login && command != logout.

Hiermee geeft u een Docker-hostserviceverbinding op. Standaard ingesteld op de host van de agent.


enforceDockerNamingConvention - Naam van installatiekopieën afdwingen om de Docker-naamconventie te volgen
boolean. Optioneel. Gebruik wanneer command != login && command != logout. Standaardwaarde: true.

De standaardwaarde wijzigt de naam van de Docker-installatiekopieën volgens de Naamconventies van Docker. Converteer hoofdletters bijvoorbeeld naar kleine letters en verwijder spaties.


memoryLimit - Geheugenlimiet
string. Optioneel. Gebruik wanneer command != login && command != logout.

Hiermee geeft u de maximale hoeveelheid geheugen die beschikbaar is voor de container op als geheel getal met optionele achtervoegsels, zoals 2GB.


Opties voor taakbeheer

Alle taken hebben besturingsopties naast hun taakinvoer. Zie Opties voor besturingselementen en algemene taakeigenschappen voor meer informatie.

Uitvoervariabelen

Deze taak definieert de volgende uitvoervariabelen, die u kunt gebruiken in downstreamstappen, taken en fasen.

DockerOutput
Slaat de uitvoer van de docker-opdracht op

DockerOutputPath
Het pad van het bestand dat de uitvoer van de build-opdracht bevat.

Deze taak definieert de volgende uitvoervariabelen, die u kunt gebruiken in downstreamstappen, taken en fasen.

DockerOutput
Slaat de uitvoer van de docker-opdracht op

Opmerkingen

Docker@2 is een nieuwere versie van deze taak die de taak vereenvoudigt door invoer te verwijderen die als argumenten kunnen worden doorgegeven aan de opdracht.

Vereisten

Vereiste Beschrijving
Pijplijntypen YAML, klassieke build, klassieke release
Wordt uitgevoerd op Agent, DeploymentGroup
Eisen Geen
Functies Deze taak voldoet niet aan eventuele vereisten voor volgende taken in de taak.
Opdrachtbeperkingen Alle
Instelbare variabelen Alle
Agentversie Alle ondersteunde agentversies.
Taakcategorie Build

Zie ook