-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathregistry.bicep
51 lines (40 loc) · 1.1 KB
/
registry.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
targetScope = 'resourceGroup'
param containerRegistryName string
param registrySku string
param location string
param dockerSourceRepo string
param branch string
param image string
param imageVersion string
resource registry 'Microsoft.ContainerRegistry/registries@2021-09-01' = {
name: containerRegistryName
location: location
sku: {
name: registrySku
}
properties: {
adminUserEnabled: true
networkRuleBypassOptions: 'AzureServices'
publicNetworkAccess: 'Enabled'
}
}
resource quickBuild 'Microsoft.ContainerRegistry/registries/taskRuns@2019-06-01-preview' = {
name: 'quickBuild'
parent: registry
location: location
properties: {
runRequest: {
type: 'DockerBuildRequest'
platform: {
os: 'Linux'
}
dockerFilePath: 'Dockerfile'
sourceLocation: '${dockerSourceRepo}#${branch}:docker'
imageNames: [
'${registry.properties.loginServer}/${image}:${imageVersion}'
]
isPushEnabled: true
}
}
}
output image string = quickBuild.properties.runRequest.imageNames[0]