Bagikan melalui


Docker@1 - Tugas Docker v1

Buat, tandai, dorong, atau jalankan gambar Docker, atau jalankan perintah Docker. Gunakan tugas ini dengan Docker atau registri Azure Container.

Catatan

Docker@2 adalah versi yang lebih baru dari tugas ini yang menyederhanakan tugas dengan menghapus input yang dapat diteruskan sebagai argumen ke perintah.

Sintaks

# 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.

Input

containerregistrytype - Jenis registri kontainer
string. Diperlukan saat command != logout. Nilai yang diizinkan: Azure Container Registry, Container Registry. Nilai default: Azure Container Registry.

Menentukan Azure Container Registry untuk menyambungkan menggunakan Koneksi Layanan Azure. Pilih Azure Container Registry untuk menyambungkan ke Docker Hub atau registri kontainer privat lainnya.


addBaseImageData - Menambahkan metadata gambar dasar ke gambar
boolean. Nilai default: true.

Nilai default menambahkan data gambar dasar, seperti nama gambar dasar dan hash, untuk membantu keterlacakan. Anda dapat menolak perilaku default ini dengan mengatur nilai ini ke false.


dockerRegistryEndpoint - Koneksi layanan registri Docker
string. Opsional. Gunakan saat containerregistrytype = Container Registry && command != logout.

Menentukan koneksi layanan registri Docker. Diperlukan untuk perintah yang mengautentikasi menggunakan registri.


azureSubscriptionEndpoint - Langganan Azure
string. Opsional. Gunakan saat containerregistrytype = Azure Container Registry && command != logout.

Menentukan langganan Azure.


azureContainerRegistry - Registri kontainer Azure
string. Pilihan. Gunakan saat containerregistrytype = Azure Container Registry && command != logout.

Menentukan Azure Container Registry di Langganan Azure yang dipilih. Gambar kontainer dibangun dan didorong ke registri kontainer ini.


command - Perintah
string. Wajib diisi. Nilai yang diizinkan: Build an image (build), Tag image (tag), Push an image (push), Run an image (run), login, logout. Nilai default: Build an image.

Menentukan perintah docker untuk dijalankan.


dockerFile - Dockerfile
string. Diperlukan saat command = Build an image || command = build. Nilai default: **/Dockerfile.

Menentukan jalur ke file Docker. Tugas ini menggunakan file docker pertama yang ditemukannya untuk membangun gambar.


arguments - Argumen
string. Pilihan. Gunakan saat command != login && command != logout.

Menentukan argumen tambahan untuk diteruskan ke klien docker. Menggunakan nilai buildAndPush dalam parameter perintah mengabaikan properti argumen.


arguments - Argumen
string. Pilihan. Gunakan saat command != Run an image && command != run && command != login && command != logout.

Menentukan argumen tambahan untuk diteruskan ke klien docker. Menggunakan nilai buildAndPush dalam parameter perintah mengabaikan properti argumen.


pushMultipleImages - Mendorong beberapa gambar
boolean. Pilihan. Gunakan saat command = Push an image || command = push. Nilai default: false.

Menentukan daftar dalam file teks gambar Docker untuk didorong. Cantumkan setiap nama gambar dalam format Imagename1:tag1 pada baris terpisah. Mencantumkan nama gambar tanpa tag, misalnya Imagename2, mendorong semua tag dalam Imagename2 kontainer.


tagMultipleImages - Memberi tag pada beberapa gambar
boolean. Pilihan. Gunakan saat command = Tag image || command = tag. Nilai default: false.

Menentukan daftar beberapa tag gambar dan gambar Docker untuk diberi tag dalam file teks. Cantumkan setiap nama gambar dalam format Imagename1:tag1 pada baris terpisah. Gambar yang tercantum tanpa tag seperti Imagename2 yang ditandai sebagai terbaru secara default.


imageName - Nama gambar
string. Diperlukan saat command = Build an image || command = build || command = Run an image || command = run || pushMultipleImages = false || tagMultipleImages = false. Nilai default: $(Build.Repository.Name):$(Build.BuildId).

Menentukan nama gambar Docker untuk membangun, mendorong, atau menjalankan.


imageNamesPath - Jalur nama gambar
string. Diperlukan saat tagMultipleImages = true || pushMultipleImages = true.

Menentukan jalur ke file teks yang berisi nama gambar Docker untuk ditandai atau didorong. Mencantumkan setiap nama gambar pada baris terpisah.


qualifyImageName - Nama gambar yang memenuhi syarat
boolean. Pilihan. Gunakan saat command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push || command = Run an image || command = run. Nilai default: true.

Menentukan nama gambar yang memenuhi syarat dengan nama host koneksi layanan registri Docker.


qualifySourceImageName - Memenuhi syarat nama gambar sumber
boolean. Pilihan. Gunakan saat command = Tag image || command = tag. Nilai default: false.

Menentukan nama gambar yang memenuhi syarat dengan nama host koneksi layanan registri Docker.


includeSourceTags - Sertakan tag sumber
boolean. Pilihan. Gunakan saat command = Build an image || command = build || command = Tag image || command = tag || command = Push an image || command = push. Nilai default: false.

Menentukan tag Git untuk disertakan saat membangun atau mendorong gambar Docker.


includeLatestTag - Sertakan tag terbaru
boolean. Pilihan. Gunakan saat command = Build an image || command = build. Nilai default: false.

Menentukan apakah akan menggunakan tag terbaru saat membuat gambar Docker.


addDefaultLabels - Menambahkan label default
boolean. Pilihan. Gunakan saat addDefaultLabels = false. Nilai default: true.

Menentukan apakah akan menambahkan metadata CI/CD ke gambar kontainer dengan menggunakan label Docker, seperti informasi repositori, penerapan, build, dan rilis.


addDefaultLabels - Menambahkan label default
boolean. Pilihan. Gunakan saat command = Build an image || command = build. Nilai default: true.

Menentukan apakah akan menambahkan metadata CI/CD ke gambar kontainer dengan menggunakan label Docker, seperti informasi repositori, penerapan, build, dan rilis.


useDefaultContext - Menggunakan konteks build default
boolean. Pilihan. Gunakan saat command = Build an image || command = build. Nilai default: true.

Menentukan penambahan atau penghapusan konteks build ke direktori yang berisi file Docker.


buildContext - Konteks build
string. Pilihan. Gunakan saat useDefaultContext = false.

Menentukan jalur ke konteks build.


imageDigestFile - File hash gambar
string. Opsional. Gunakan saat command = Push an image || command = push.

Menentukan jalur ke file yang dibuat dan diisi dengan hash repositori gambar lengkap dari gambar Docker yang didorong.


containerName - Nama kontainer
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan nama kontainer Docker yang akan dijalankan.


ports - Port
string. Opsional. Gunakan saat command = Run an image || command = run.

Menentukan port dalam kontainer Docker untuk diterbitkan ke host. Mencantumkan setiap host-port:container-port pengikatan pada baris terpisah.


volumes - Volume
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan volume yang akan dipasang dari host. Cantumkan masing-masing host-dir:container-dir pada baris terpisah.


envVars - Variabel lingkungan
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan variabel lingkungan untuk kontainer Docker. Mencantumkan setiap name=value pasangan pada baris terpisah.


workingDirectory - Direktori kerja
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan direktori kerja untuk kontainer Docker.


entrypointOverride - Penimpaan titik masuk
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan apakah akan mengganti titik entri default untuk kontainer Docker.


containerCommand - Perintah kontainer
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan perintah jalankan Docker. Perintah jalankan docker terlebih dahulu membuat lapisan kontainer yang dapat ditulis di atas gambar yang ditentukan, lalu memulainya dengan menggunakan perintah jalankan yang ditentukan. Misalnya, jika gambar berisi aplikasi web Python Flask sederhana, Anda dapat menentukan python app.py untuk meluncurkan aplikasi web.


containerCommand - Perintah
string. Pilihan. Gunakan saat command = Run an image || command = run.

Menentukan perintah jalankan Docker. Perintah jalankan docker terlebih dahulu membuat lapisan kontainer yang dapat ditulis di atas gambar yang ditentukan, lalu memulainya dengan menggunakan perintah jalankan yang ditentukan. Misalnya, jika gambar berisi aplikasi web Python Flask sederhana, Anda dapat menentukan python app.py untuk meluncurkan aplikasi web.


runInBackground - Jalankan di latar belakang
boolean. Pilihan. Gunakan saat command = Run an image || command = run. Nilai default: true.

Menentukan apakah akan menjalankan kontainer Docker di latar belakang.


restartPolicy - Mulai ulang kebijakan
string. Diperlukan saat runInBackground = true. Nilai yang diizinkan: no, onFailure (Saat gagal), always, unlessStopped (Kecuali dihentikan). Nilai default: no.

Menentukan kapan menjalankan kebijakan hidupkan ulang.


maxRestartRetries - Percobaan ulang mulai ulang maksimum
string. Pilihan. Gunakan saat runInBackground = true && restartPolicy = onFailure.

Menentukan jumlah maksimum mulai ulang upaya daemon Docker.


dockerHostEndpoint - Koneksi layanan host Docker
string. Pilihan. Gunakan saat command != login && command != logout.

Menentukan koneksi layanan host Docker. Default ke host agen.


enforceDockerNamingConvention - Paksa nama gambar untuk mengikuti konvensi penamaan Docker
boolean. Pilihan. Gunakan saat command != login && command != logout. Nilai default: true.

Nilai default memodifikasi nama gambar Docker sesuai dengan konvensi penamaan Docker. Misalnya, konversi karakter huruf besar menjadi huruf kecil dan hapus spasi.


memoryLimit - Batas memori
string. Opsional. Gunakan saat command != login && command != logout.

Menentukan jumlah maksimum memori yang tersedia untuk kontainer sebagai bilangan bulat dengan akhiran opsional seperti 2GB.


Opsi kontrol tugas

Semua tugas memiliki opsi kontrol selain input tugas mereka. Untuk informasi selengkapnya, lihat Opsi kontrol dan properti tugas umum.

Variabel output

Tugas ini menentukan variabel output berikut, yang dapat Anda konsumsi dalam langkah-langkah hilir, pekerjaan, dan tahapan.

DockerOutput
Menyimpan output perintah docker

DockerOutputPath
Jalur file yang berisi output perintah build.

Tugas ini menentukan variabel output berikut, yang dapat Anda konsumsi dalam langkah-langkah hilir, pekerjaan, dan tahapan.

DockerOutput
Menyimpan output perintah docker

Keterangan

Docker@2 adalah versi yang lebih baru dari tugas ini yang menyederhanakan tugas dengan menghapus input yang dapat diteruskan sebagai argumen ke perintah.

Persyaratan

Persyaratan Deskripsi
Jenis alur YAML, Build klasik, Rilis klasik
Berjalan pada Agen, DeploymentGroup
Permintaan Tidak ada
Kemampuan Tugas ini tidak memenuhi tuntutan untuk tugas berikutnya dalam pekerjaan.
Pembatasan perintah Apa pun
Variabel yang dapat diatur Apa pun
Versi agen Semua versi agen yang didukung.
Kategori tugas Build

Lihat juga