-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-bake.hcl
99 lines (87 loc) · 2.76 KB
/
docker-bake.hcl
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
variable "TAG" {
default = "local"
}
variable "REPOSITORY" {
default = "ghcr.io/cwrc"
}
# The digest (sha256 hash) is not platform specific but the digest for the manifest of all platforms.
# It will be the digest printed when you do: docker pull alpine:3.17.1
# Not the one displayed on DockerHub.
# Variable names with '_TAG' and '_REPOSITORY' fail with docker/bake-action
variable "LEAF_VERSION" {
default = "local"
}
variable "LEAF_REGISTRY" {
default = "registry.gitlab.com/calincs/cwrc/leaf/leaf-base-i8"
}
group "default" {
targets = ["drupal"]
}
###############################################################################
# Common target properties.
###############################################################################
target "common" {
args = {
# Required for reproduciable builds.
# Requires Buildkit 0.11+
# See: https://reproducible-builds.org/docs/source-date-epoch/
# SOURCE_DATE_EPOCH = "${SOURCE_DATE_EPOCH}",
}
}
# https://github.com/docker/metadata-action?tab=readme-ov-file#bake-definition
# bake definition file that can be used with the Docker Bake action. You just
# have to declare an empty target named docker-metadata-action and inherit from it.
target "docker-metadata-action" {}
###############################################################################
# Helper Targets.
###############################################################################
target "leaf-version-update-helper" {
inherits = ["common"]
context = "."
dockerfile = "docker/drupal/Dockerfile-bake-update-helper"
contexts = {
}
tags = [
"${REPOSITORY}/leaf-version-update-helper:${TAG}"
]
args = {
LEAF_VERSION="${LEAF_VERSION}"
}
}
target "drupal-core-extension-helper" {
inherits = ["common"]
context = "docker/drupal"
dockerfile = "Dockerfile-core-extensions-helper"
contexts = {
}
tags = [
"${REPOSITORY}/drupal-core-extension-helper:${TAG}"
]
}
target "drupal-composer-helper" {
inherits = ["common"]
context = "docker/drupal"
dockerfile = "Dockerfile-composer-helper"
contexts = {
leaf_base_drupal = "docker-image://${LEAF_REGISTRY}/drupal:${LEAF_VERSION}"
}
tags = [
"${REPOSITORY}/drupal:${TAG}"
]
}
###############################################################################
# Target.
###############################################################################
target "drupal" {
inherits = ["common", "docker-metadata-action"]
context = "docker/drupal"
dockerfile = "Dockerfile"
contexts = {
leaf_base_drupal = "docker-image://${LEAF_REGISTRY}/drupal:${LEAF_VERSION}"
#leaf_base_drupal = "docker-image://registry.gitlab.com/calincs/cwrc/leaf/leaf-base-i8/drupal:3.0.7"
}
# platforms = [
# "linux/amd64",
# "linux/arm64",
# ]
}