docker-bake.hcl 797 B

12345678910111213141516171819202122232425262728293031
  1. # Bake definition: multi-arch static image (task 45).
  2. # Usage: `docker buildx bake` (both arches) or
  3. # `docker buildx bake image --set image.platform=linux/amd64` (one arch).
  4. variable "TAG" {
  5. default = "latest"
  6. }
  7. # Comma-separated tag list. Must be an env var, not `--set image.tags=`: bake
  8. # parses a `--set` value as one string, so a comma list becomes a single
  9. # invalid tag instead of several.
  10. variable "IMAGE_TAGS" {
  11. default = ""
  12. }
  13. variable "SOURCE_DATE_EPOCH" {
  14. default = "0"
  15. }
  16. group "default" {
  17. targets = ["image"]
  18. }
  19. target "image" {
  20. dockerfile = "Dockerfile"
  21. context = "."
  22. platforms = ["linux/amd64", "linux/arm64"]
  23. tags = IMAGE_TAGS != "" ? split(",", IMAGE_TAGS) : ["d-oauth-server:${TAG}"]
  24. args = {
  25. SOURCE_DATE_EPOCH = "${SOURCE_DATE_EPOCH}"
  26. }
  27. }