Bagikan melalui


DockerCompose@0 - Tugas Docker Compose v0

Membangun, mendorong, atau menjalankan aplikasi Docker multi-kontainer. Gunakan tugas ini dengan Docker atau registri Azure Container.

Sintaks

# Docker Compose v0
# Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
- task: DockerCompose@0
  inputs:
    containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required. Container Registry Type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry. Docker Registry Service Connection. 
    #azureSubscription: # string. Alias: azureSubscriptionEndpoint. Optional. Use when containerregistrytype = Azure Container Registry. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry. Azure Container Registry. 
    dockerComposeFile: '**/docker-compose.yml' # string. Required. Docker Compose File. Default: **/docker-compose.yml.
    #additionalDockerComposeFiles: # string. Additional Docker Compose Files. 
    #dockerComposeFileArgs: # string. Environment Variables. 
    #projectName: '$(Build.Repository.Name)' # string. Project Name. Default: $(Build.Repository.Name).
    #qualifyImageNames: true # boolean. Qualify Image Names. Default: true.
    action: 'Run a Docker Compose command' # 'Build services' | 'Push services' | 'Run services' | 'Run a specific service' | 'Lock services' | 'Write service image digests' | 'Combine configuration' | 'Run a Docker Compose command'. Required. Action. Default: Run a Docker Compose command.
    #additionalImageTags: # string. Optional. Use when action = Build services || action = Push services. Additional Image Tags. 
    #includeSourceTags: false # boolean. Optional. Use when action = Build services || action = Push services. Include Source Tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when action = Build services || action = Push services. Include Latest Tag. Default: false.
    #buildImages: true # boolean. Optional. Use when action = Run services. Build Images. Default: true.
    #serviceName: # string. Required when action = Run a specific service. Service Name. 
    #containerName: # string. Optional. Use when action = Run a specific service. Container Name. 
    #ports: # string. Optional. Use when action = Run a specific service. Ports. 
    #workingDirectory: # string. Alias: workDir. Optional. Use when action = Run a specific service. Working Directory. 
    #entrypoint: # string. Optional. Use when action = Run a specific service. Entry Point Override. 
    #containerCommand: # string. Optional. Use when action = Run a specific service. Command. 
    #detached: true # boolean. Optional. Use when action = Run services || action = Run a specific service. Run in Background. Default: true.
    #abortOnContainerExit: true # boolean. Optional. Use when action = Run services && detached == false. Abort on Container Exit. Default: true.
    #imageDigestComposeFile: '$(Build.StagingDirectory)/docker-compose.images.yml' # string. Required when action = Write service image digests. Image Digest Compose File. Default: $(Build.StagingDirectory)/docker-compose.images.yml.
    #removeBuildOptions: false # boolean. Optional. Use when action = Lock services || action = Combine configuration. Remove Build Options. Default: false.
    #baseResolveDirectory: # string. Optional. Use when action = Lock services || action = Combine configuration. Base Resolve Directory. 
    #outputDockerComposeFile: '$(Build.StagingDirectory)/docker-compose.yml' # string. Required when action = Lock services || action = Combine configuration. Output Docker Compose File. Default: $(Build.StagingDirectory)/docker-compose.yml.
    #dockerComposeCommand: # string. Required when action = Run a Docker Compose command. Command. 
    #arguments: # string. Optional. Use when action != Lock services && action != Combine configuration && action != Write service image digests. Arguments. 
  # Advanced Options
    #dockerHostEndpoint: # string. Docker Host Service Connection. 
    #nopIfNoDockerComposeFile: false # boolean. No-op if no Docker Compose File. Default: false.
    #requireAdditionalDockerComposeFiles: false # boolean. Require Additional Docker Compose Files. Default: false.
    #currentWorkingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd. Working Directory. Default: $(System.DefaultWorkingDirectory).
    #dockerComposePath: # string. Docker Compose executable Path.
# Docker Compose v0
# Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
- task: DockerCompose@0
  inputs:
    containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required. Container Registry Type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry. Docker Registry Service Connection. 
    #azureSubscription: # string. Alias: azureSubscriptionEndpoint. Optional. Use when containerregistrytype = Azure Container Registry. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry. Azure Container Registry. 
    dockerComposeFile: '**/docker-compose.yml' # string. Required. Docker Compose File. Default: **/docker-compose.yml.
    #additionalDockerComposeFiles: # string. Additional Docker Compose Files. 
    #dockerComposeFileArgs: # string. Environment Variables. 
    #projectName: '$(Build.Repository.Name)' # string. Project Name. Default: $(Build.Repository.Name).
    #qualifyImageNames: true # boolean. Qualify Image Names. Default: true.
    action: 'Run a Docker Compose command' # 'Build services' | 'Push services' | 'Run services' | 'Run a specific service' | 'Lock services' | 'Write service image digests' | 'Combine configuration' | 'Run a Docker Compose command'. Required. Action. Default: Run a Docker Compose command.
    #additionalImageTags: # string. Optional. Use when action = Build services || action = Push services. Additional Image Tags. 
    #includeSourceTags: false # boolean. Optional. Use when action = Build services || action = Push services. Include Source Tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when action = Build services || action = Push services. Include Latest Tag. Default: false.
    #buildImages: true # boolean. Optional. Use when action = Run services. Build Images. Default: true.
    #serviceName: # string. Required when action = Run a specific service. Service Name. 
    #containerName: # string. Optional. Use when action = Run a specific service. Container Name. 
    #ports: # string. Optional. Use when action = Run a specific service. Ports. 
    #workingDirectory: # string. Alias: workDir. Optional. Use when action = Run a specific service. Working Directory. 
    #entrypoint: # string. Optional. Use when action = Run a specific service. Entry Point Override. 
    #containerCommand: # string. Optional. Use when action = Run a specific service. Command. 
    #detached: true # boolean. Optional. Use when action = Run services || action = Run a specific service. Run in Background. Default: true.
    #abortOnContainerExit: true # boolean. Optional. Use when action = Run services && detached == false. Abort on Container Exit. Default: true.
    #imageDigestComposeFile: '$(Build.StagingDirectory)/docker-compose.images.yml' # string. Required when action = Write service image digests. Image Digest Compose File. Default: $(Build.StagingDirectory)/docker-compose.images.yml.
    #removeBuildOptions: false # boolean. Optional. Use when action = Lock services || action = Combine configuration. Remove Build Options. Default: false.
    #baseResolveDirectory: # string. Optional. Use when action = Lock services || action = Combine configuration. Base Resolve Directory. 
    #outputDockerComposeFile: '$(Build.StagingDirectory)/docker-compose.yml' # string. Required when action = Lock services || action = Combine configuration. Output Docker Compose File. Default: $(Build.StagingDirectory)/docker-compose.yml.
    #dockerComposeCommand: # string. Required when action = Run a Docker Compose command. Command. 
    #arguments: # string. Optional. Use when action != Lock services && action != Combine configuration && action != Write service image digests. Arguments. 
  # Advanced Options
    #dockerHostEndpoint: # string. Docker Host Service Connection. 
    #nopIfNoDockerComposeFile: false # boolean. No-op if no Docker Compose File. Default: false.
    #requireAdditionalDockerComposeFiles: false # boolean. Require Additional Docker Compose Files. Default: false.
    #currentWorkingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd. Working Directory. Default: $(System.DefaultWorkingDirectory).
# Docker Compose v0
# Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
- task: DockerCompose@0
  inputs:
    containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Container Registry'. Required. Container Registry Type. Default: Azure Container Registry.
    #dockerRegistryEndpoint: # string. Optional. Use when containerregistrytype = Container Registry. Docker Registry Service Connection. 
    #azureSubscription: # string. Alias: azureSubscriptionEndpoint. Optional. Use when containerregistrytype = Azure Container Registry. Azure subscription. 
    #azureContainerRegistry: # string. Optional. Use when containerregistrytype = Azure Container Registry. Azure Container Registry. 
    dockerComposeFile: '**/docker-compose.yml' # string. Required. Docker Compose File. Default: **/docker-compose.yml.
    #additionalDockerComposeFiles: # string. Additional Docker Compose Files. 
    #dockerComposeFileArgs: # string. Environment Variables. 
    #projectName: '$(Build.Repository.Name)' # string. Project Name. Default: $(Build.Repository.Name).
    #qualifyImageNames: true # boolean. Qualify Image Names. Default: true.
    action: 'Run a Docker Compose command' # 'Build services' | 'Push services' | 'Run services' | 'Run a specific service' | 'Lock services' | 'Write service image digests' | 'Combine configuration' | 'Run a Docker Compose command'. Required. Action. Default: Run a Docker Compose command.
    #additionalImageTags: # string. Optional. Use when action = Build services || action = Push services. Additional Image Tags. 
    #includeSourceTags: false # boolean. Optional. Use when action = Build services || action = Push services. Include Source Tags. Default: false.
    #includeLatestTag: false # boolean. Optional. Use when action = Build services || action = Push services. Include Latest Tag. Default: false.
    #buildImages: true # boolean. Optional. Use when action = Run services. Build Images. Default: true.
    #serviceName: # string. Required when action = Run a specific service. Service Name. 
    #containerName: # string. Optional. Use when action = Run a specific service. Container Name. 
    #ports: # string. Optional. Use when action = Run a specific service. Ports. 
    #workingDirectory: # string. Alias: workDir. Optional. Use when action = Run a specific service. Working Directory. 
    #entrypoint: # string. Optional. Use when action = Run a specific service. Entry Point Override. 
    #containerCommand: # string. Optional. Use when action = Run a specific service. Command. 
    #detached: true # boolean. Optional. Use when action = Run services || action = Run a specific service. Run in Background. Default: true.
    #abortOnContainerExit: true # boolean. Optional. Use when action = Run services && detached == false. Abort on Container Exit. Default: true.
    #imageDigestComposeFile: '$(Build.StagingDirectory)/docker-compose.images.yml' # string. Required when action = Write service image digests. Image Digest Compose File. Default: $(Build.StagingDirectory)/docker-compose.images.yml.
    #removeBuildOptions: false # boolean. Optional. Use when action = Lock services || action = Combine configuration. Remove Build Options. Default: false.
    #baseResolveDirectory: # string. Optional. Use when action = Lock services || action = Combine configuration. Base Resolve Directory. 
    #outputDockerComposeFile: '$(Build.StagingDirectory)/docker-compose.yml' # string. Required when action = Lock services || action = Combine configuration. Output Docker Compose File. Default: $(Build.StagingDirectory)/docker-compose.yml.
    #dockerComposeCommand: # string. Required when action = Run a Docker Compose command. Command. 
  # Advanced Options
    #dockerHostEndpoint: # string. Docker Host Service Connection. 
    #nopIfNoDockerComposeFile: false # boolean. No-op if no Docker Compose File. Default: false.
    #requireAdditionalDockerComposeFiles: false # boolean. Require Additional Docker Compose Files. Default: false.
    #currentWorkingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd. Working Directory. Default: $(System.DefaultWorkingDirectory).

Input

containerregistrytype - Jenis Container Registry
string. Wajib diisi. Nilai yang diizinkan: Azure Container Registry, Container Registry. Nilai default: Azure Container Registry.

Menentukan jenis Azure Container Registry jika menggunakan ACR. Tentukan jenis Container Registry jika menggunakan registri kontainer lainnya.


dockerRegistryEndpoint - Koneksi Layanan Docker Registry
string. Pilihan. Gunakan saat containerregistrytype = Container Registry.

Menentukan koneksi layanan registri Docker. Diperlukan saat perintah perlu mengautentikasi menggunakan registri.


azureSubscription - Langganan Azure
Alias input: azureSubscriptionEndpoint. string. Opsional. Gunakan saat containerregistrytype = Azure Container Registry.

Menentukan langganan Azure. Nama Koneksi Layanan Azure. Untuk menyiapkan koneksi secara manual, lihat Koneksi layanan Azure Resource Manager.


azureContainerRegistry - Azure Container Registry
string. Pilihan. Gunakan saat containerregistrytype = Azure Container Registry.

Menentukan Azure Container Registry.


dockerComposeFile - Docker Compose File
string. Wajib diisi. Nilai default: **/docker-compose.yml.

Menentukan jalur file ke file Docker Compose utama.


additionalDockerComposeFiles - File Docker Compose Tambahan
string.

Menentukan file Docker Compose tambahan yang dikombinasikan dengan file Docker Compose utama. Jalur relatif diselesaikan relatif terhadap direktori yang berisi file Docker Compose utama. Jika file yang ditentukan tidak ditemukan, file akan diabaikan. Tentukan setiap jalur file pada baris baru.


dockerComposeFileArgs - Variabel Lingkungan
string.

Menentukan variabel lingkungan apa pun yang diatur.

Format sebagai berikut:

  • Mencantumkan setiap name=value pasangan pada baris baru.
  • | Gunakan operator di YAML untuk mempertahankan baris baru.

projectName - Nama Proyek
string. Nilai default: $(Build.Repository.Name).

Menentukan nama proyek yang akan digunakan secara default untuk memberi nama gambar dan kontainer.


qualifyImageNames - Nama Gambar yang Memenuhi Syarat
boolean. Nilai default: true.

Secara default, menentukan nama host koneksi layanan registri Docker.


action - Tindakan
string. Wajib diisi. Nilai yang diizinkan: Build services (Gambar layanan build), Push services (Gambar layanan push), Run services (Jalankan gambar layanan), Run a specific service (Jalankan gambar layanan tertentu), Lock services (Kunci gambar layanan), Write service image digests, Combine configuration, Run a Docker Compose command. Nilai default: Run a Docker Compose command.

Menentukan tindakan Docker Compose dari daftar nilai yang diizinkan.


additionalImageTags - Tag Gambar Tambahan
string. Opsional. Gunakan saat action = Build services || action = Push services.

Menentukan tag tambahan untuk gambar Docker yang sedang dibuat atau didorong. Anda dapat menentukan beberapa tag yang memisahkan masing-masing dengan umpan \nbaris .


includeSourceTags - Sertakan Tag Sumber
boolean. Pilihan. Gunakan saat action = Build services || action = Push services. Nilai default: false.

Menentukan tag Git saat membangun atau mendorong gambar Docker.


includeLatestTag - Sertakan Tag Terbaru
boolean. Pilihan. Gunakan saat action = Build services || action = Push services. Nilai default: false.

Menentukan tag terbaru saat membangun atau mendorong gambar Docker.


buildImages - Bangun Gambar
boolean. Pilihan. Gunakan saat action = Run services. Nilai default: true.

Menentukan gambar build sebelum memulai kontainer layanan.


serviceName - Nama Layanan
string. Diperlukan saat action = Run a specific service.

Menentukan nama layanan yang ingin Anda jalankan.


containerName - Nama Kontainer
string. Pilihan. Gunakan saat action = Run a specific service.

Menentukan nama kontainer layanan yang ingin Anda gunakan.


ports - Port
string. Pilihan. Gunakan saat action = Run a specific service.

Menentukan port dalam kontainer layanan untuk diterbitkan ke host. Tambahkan setiap host-port:container-port pengikatan pada baris baru.


workingDirectory - Direktori Kerja
Alias input: workDir. string. Opsional. Gunakan saat action = Run a specific service.

Menentukan direktori kerja untuk kontainer layanan.


entrypoint - Penimpaan Titik Masuk
string. Opsional. Gunakan saat action = Run a specific service.

Menentukan nilai penimpaan untuk titik entri default kontainer layanan.


containerCommand - Perintah
string. Pilihan. Gunakan saat action = Run a specific service.

Menentukan perintah yang akan dijalankan dalam kontainer layanan. Misalnya, jika gambar berisi aplikasi web Python Flask sederhana yang dapat Anda tentukan python app.py untuk meluncurkan aplikasi web.


detached - Jalankan di Latar Belakang
boolean. Pilihan. Gunakan saat action = Run services || action = Run a specific service. Nilai default: true.

Menentukan kontainer layanan untuk dijalankan di latar belakang.


abortOnContainerExit - Batalkan saat Kontainer Keluar
boolean. Pilihan. Gunakan saat action = Run services && detached == false. Nilai default: true.

Menentukan semua kontainer yang harus berhenti ketika ada kontainer yang keluar.


imageDigestComposeFile - File Buat Gambar Digest
string. Diperlukan saat action = Write service image digests. Nilai default: $(Build.StagingDirectory)/docker-compose.images.yml.

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


removeBuildOptions - Hapus Opsi Build
boolean. Pilihan. Gunakan saat action = Lock services || action = Combine configuration. Nilai default: false.

Menentukan apakah opsi build harus dihapus dari file Docker Compose output.


baseResolveDirectory - Base Resolve Directory
string. Pilihan. Gunakan saat action = Lock services || action = Combine configuration.

Menentukan direktori dasar tempat jalur relatif dalam file Docker Compose output harus diselesaikan.


outputDockerComposeFile - Output Docker Compose File
string. Diperlukan saat action = Lock services || action = Combine configuration. Nilai default: $(Build.StagingDirectory)/docker-compose.yml.

Menentukan jalur ke file Docker Compose output.


dockerComposeCommand - Perintah
string. Diperlukan saat action = Run a Docker Compose command.

Menentukan perintah Docker Compose untuk dijalankan dengan argumen. Misalnya, rm --all untuk menghapus semua kontainer layanan yang dihentikan.


arguments - Argumen
string. Pilihan. Gunakan saat action != Lock services && action != Combine configuration && action != Write service image digests.

Menentukan opsi perintah Docker Compose.

Contoh: Untuk perintah build, --pull --compress --parallel.


dockerHostEndpoint - Koneksi Layanan Host Docker
string.

Menentukan koneksi layanan host Docker. Default ke host agen.


nopIfNoDockerComposeFile - No-op jika tidak ada Docker Compose File
boolean. Nilai default: false.

Menentukan nilai untuk melewati tugas jika file Docker Compose tidak ada. Opsi ini berguna ketika tugas menawarkan perilaku opsional berdasarkan keberadaan file Docker Compose di repositori.


requireAdditionalDockerComposeFiles - Memerlukan File Docker Compose Tambahan
boolean. Nilai default: false.

Menentukan nilai untuk menghasilkan kesalahan jika file Docker Compose tambahan tidak ada. Opsi ini mengambil alih perilaku default yang akan mengabaikan file jika tidak ada.


currentWorkingDirectory - Direktori Kerja
Alias input: cwd. string. Nilai default: $(System.DefaultWorkingDirectory).

Menentukan direktori kerja untuk perintah Docker Compose.


dockerComposePath - Jalur yang dapat dieksekusi Docker Compose
string.

Menentukan jalur untuk menentukan apakah docker-compose executable digunakan.


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 mendefinisikan variabel output berikut, yang dapat Anda konsumsi dalam langkah-langkah hilir, pekerjaan, dan tahapan.

DockerComposeOutput
Jalur ke file yang berisi output perintah. Ini dapat berisi beberapa jalur file (dipisahkan oleh karakter baris baru) seperti, perintah dockerComposeRun (satu untuk berjalan dan satu untuk tidak berfungsi), dockerPush (satu untuk setiap gambar yang didorong), dockerBuild (build itu sendiri dan semua perintah tag) dan dockerDigest (satu untuk setiap gambar yang ditarik). Perintah lainnya hanya menghasilkan satu file.

Tidak ada.

Keterangan

Gunakan tugas ini untuk membangun, mendorong, atau menjalankan aplikasi Docker multi-kontainer. Gunakan tugas ini dengan registri Docker atau Azure Container Registry.

Contoh

Azure Container Registry

Contoh YAML ini menentukan input untuk Azure Container Registry:

variables:
  azureContainerRegistry: Contoso.azurecr.io
  azureSubscriptionEndpoint: Contoso
steps:
- task: DockerCompose@0
  displayName: Container registry login
  inputs:
    containerregistrytype: Azure Container Registry
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)

Registri kontainer lainnya

Nilai containerregistrytype diperlukan saat menggunakan registri kontainer apa pun selain ACR. Gunakan containerregistrytype: Container Registry dalam kasus ini.

Contoh YAML ini menentukan registri kontainer selain ACR di mana Contoso adalah nama koneksi layanan registri Docker untuk registri kontainer:

- task: DockerCompose@0
  displayName: Container registry login
  inputs:
    containerregistrytype: Container Registry
    dockerRegistryEndpoint: Contoso

Gambar layanan build

Contoh YAML ini membangun gambar di mana nama gambar memenuhi syarat berdasarkan input yang terkait dengan Azure Container Registry:

- task: DockerCompose@0
  displayName: Build services
  inputs:
    action: Build services
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    additionalImageTags: $(Build.BuildId)
    dockerComposeFileArgs: |
      firstArg=$(firstArg)
      secondArg=$(secondArg)

Gambar layanan pendorongan

Contoh YAML ini mendorong gambar ke registri kontainer:

- task: DockerCompose@0
  displayName: Push services
  inputs:
    action: Push services
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    additionalImageTags: $(Build.BuildId)

Menjalankan gambar layanan

Contoh YAML ini menjalankan layanan:

- task: DockerCompose@0
  displayName: Run services
  inputs:
    action: Run services
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.ci.build.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    buildImages: true
    abortOnContainerExit: true
    detached: true

Menjalankan gambar layanan tertentu

Contoh YAML ini menjalankan layanan tertentu:

- task: DockerCompose@0
  displayName: Run a specific service
  inputs:
    action: Run a specific service
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    serviceName: myhealth.web
    ports: 80:80
    detached: true

Mengunci gambar layanan

Contoh YAML ini mengunci layanan:

- task: DockerCompose@0
  displayName: Lock services
  inputs:
    action: Lock services
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    outputDockerComposeFile: $(Build.StagingDirectory)/docker-compose.yml

Menulis hash gambar layanan

Contoh YAML ini menulis hash gambar layanan:

- task: DockerCompose@0
  displayName: Write service image digests
  inputs:
    action: Write service image digests
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    imageDigestComposeFile: $(Build.StagingDirectory)/docker-compose.images.yml 

Gabungkan konfigurasi

Contoh YAML ini menggabungkan konfigurasi:

- task: DockerCompose@0
  displayName: Combine configuration
  inputs:
    action: Combine configuration
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml
    additionalDockerComposeFiles: docker-compose.override.yml
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    outputDockerComposeFile: $(Build.StagingDirectory)/docker-compose.yml

Menjalankan perintah Docker Compose

Contoh YAML ini menjalankan perintah docker Compose:

- task: DockerCompose@0
  displayName: Run a Docker Compose command
  inputs:
    action: Run a Docker Compose command
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: $(azureContainerRegistry)
    dockerComposeFile: docker-compose.yml 
    projectName: $(Build.Repository.Name)
    qualifyImageNames: true
    dockerComposeCommand: rm

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