Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Sumber daya kontainer mereferensikan gambar kontainer.
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.
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.
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.
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.
Definisi yang mereferensikan definisi ini: resources.containers
Sifat
container tali. Diperlukan sebagai properti pertama.
id untuk kontainer. Nilai yang dapat diterima: [-_A-Za-z0-9]*.
image tali. Dibutuhkan.
tag gambar Kontainer.
type tali.
Jenis registri seperti ACR atau GCR.
trigger
resources.containers.container.trigger.
Tentukan tidak ada yang akan dinonaktifkan, benar untuk dipicu pada semua tag gambar, atau gunakan sintaks lengkap seperti yang dijelaskan dalam contoh berikut.
azureSubscription tali.
langganan Azure (koneksi layanan ARM) untuk registri kontainer.
resourceGroup tali.
Grup sumber daya untuk ACR Anda.
registry tali.
Registri untuk gambar kontainer.
repository tali.
Nama repositori gambar kontainer di ACR.
localImage
boolean.
Jika benar, menggunakan gambar yang ditandai secara lokal alih-alih menggunakan penarikan docker untuk mendapatkan gambar. Defaultnya adalah false.
Properti ini hanya berguna untuk agen yang dihost sendiri di mana gambar sudah ada di komputer agen.
endpoint tali.
ID titik akhir layanan yang terhubung ke registri kontainer privat. ekspresi Templat didukung.
endpoint tali.
ID titik akhir layanan yang terhubung ke registri kontainer privat.
env kamus string.
Variabel untuk dipetakan ke lingkungan kontainer.
mapDockerSocket
boolean.
Atur bendera ini ke false untuk memaksa agen tidak mengatur volume /var/run/docker.sock pada pekerjaan kontainer.
options tali.
Opsi untuk diteruskan ke host kontainer. ekspresi Templat didukung.
options tali.
Opsi untuk diteruskan ke host kontainer.
ports daftar string.
Port untuk diekspos pada kontainer. ekspresi Templat didukung.
ports daftar string.
Port untuk diekspos pada kontainer.
volumes daftar string.
Volume untuk dipasang pada kontainer. ekspresi Templat didukung.
volumes daftar string.
Volume untuk dipasang pada kontainer.
mountReadOnly
mountReadOnly.
Volume untuk memasang baca-saja, defaultnya adalah false.
Komentar
pekerjaan Kontainer memungkinkan Anda mengisolasi alat dan dependensi di dalam kontainer.
Agen meluncurkan instans kontainer yang Anda tentukan kemudian menjalankan langkah-langkah di dalamnya.
Kata kunci container memungkinkan Anda menentukan gambar kontainer Anda.
Kontainer Layanan berjalan bersama pekerjaan untuk menyediakan berbagai dependensi seperti database.
Ekspresi templat didukung untuk properti endpoint, volumes, ports, dan options sumber daya kontainer dalam alur YAML.
Contoh
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