From f90d96b658486f474c6ef55be4cb978444cb3f9f Mon Sep 17 00:00:00 2001 From: Martin Reinhardt Date: Mon, 7 Nov 2022 07:27:02 +0100 Subject: [PATCH] feat(ARM): Adding ARM Platform on packer --- docker/_base/build.pkr.hcl | 20 ++++++++++++++------ docker/ansible/build.pkr.hcl | 21 +++++++++++++++------ docker/java/openjdk11.pkr.hcl | 21 +++++++++++++++------ docker/java/openjdk17.pkr.hcl | 21 +++++++++++++++------ docker/nodejs/build.pkr.hcl | 21 +++++++++++++++------ docker/terraform/build.pkr.hcl | 21 +++++++++++++++------ 6 files changed, 89 insertions(+), 36 deletions(-) diff --git a/docker/_base/build.pkr.hcl b/docker/_base/build.pkr.hcl index f90b115..b5a8c2c 100644 --- a/docker/_base/build.pkr.hcl +++ b/docker/_base/build.pkr.hcl @@ -1,13 +1,21 @@ +source "docker" "amd64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "buildpack-deps:buster" + pull = false + platform = "linux/amd64" +} -source "docker" "autogenerated_1" { - changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] - commit = true - image = "buildpack-deps:buster" - pull = true +source "docker" "arm64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "buildpack-deps:buster" + pull = false + platform = "linux/arm64" } build { - sources = ["source.docker.autogenerated_1"] + sources = ["source.docker.amd64", "source.docker.arm64"] provisioner "ansible" { extra_arguments = ["-v"] diff --git a/docker/ansible/build.pkr.hcl b/docker/ansible/build.pkr.hcl index 6ef71c8..973bb93 100644 --- a/docker/ansible/build.pkr.hcl +++ b/docker/ansible/build.pkr.hcl @@ -4,15 +4,24 @@ variable "image_tag" { default = env("IMAGE_TAG") } -source "docker" "autogenerated_1" { - changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] - commit = true - image = "toolisticon/base-builder-image" - pull = false +source "docker" "amd64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/amd64" +} + +source "docker" "arm64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/arm64" } build { - sources = ["source.docker.autogenerated_1"] + sources = ["source.docker.amd64", "source.docker.amd64"] provisioner "ansible" { extra_arguments = ["-v"] diff --git a/docker/java/openjdk11.pkr.hcl b/docker/java/openjdk11.pkr.hcl index 7a24fe2..268e103 100644 --- a/docker/java/openjdk11.pkr.hcl +++ b/docker/java/openjdk11.pkr.hcl @@ -4,15 +4,24 @@ variable "image_tag" { default = env("IMAGE_TAG") } -source "docker" "autogenerated_1" { - changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] - commit = true - image = "toolisticon/base-builder-image" - pull = false +source "docker" "amd64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/amd64" +} + +source "docker" "arm64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/arm64" } build { - sources = ["source.docker.autogenerated_1"] + sources = ["source.docker.amd64", "source.docker.arm64"] provisioner "ansible" { extra_arguments = ["-v"] diff --git a/docker/java/openjdk17.pkr.hcl b/docker/java/openjdk17.pkr.hcl index 874ac95..b7ae695 100644 --- a/docker/java/openjdk17.pkr.hcl +++ b/docker/java/openjdk17.pkr.hcl @@ -4,15 +4,24 @@ variable "image_tag" { default = env("IMAGE_TAG") } -source "docker" "autogenerated_1" { - changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] - commit = true - image = "toolisticon/base-builder-image" - pull = false +source "docker" "amd64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/amd64" +} + +source "docker" "arm64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/arm64" } build { - sources = ["source.docker.autogenerated_1"] + sources = ["source.docker.amd64", "source.docker.arm64"] provisioner "ansible" { extra_arguments = ["-v"] diff --git a/docker/nodejs/build.pkr.hcl b/docker/nodejs/build.pkr.hcl index 762fc69..d9026a2 100644 --- a/docker/nodejs/build.pkr.hcl +++ b/docker/nodejs/build.pkr.hcl @@ -4,15 +4,24 @@ variable "image_tag" { default = env("IMAGE_TAG") } -source "docker" "autogenerated_1" { - changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] - commit = true - image = "toolisticon/base-builder-image" - pull = false +source "docker" "amd64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/amd64" +} + +source "docker" "arm64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/arm64" } build { - sources = ["source.docker.autogenerated_1"] + sources = ["source.docker.amd64", "source.docker.arm64"] provisioner "ansible" { extra_arguments = ["-v"] diff --git a/docker/terraform/build.pkr.hcl b/docker/terraform/build.pkr.hcl index f66d301..aad10d9 100644 --- a/docker/terraform/build.pkr.hcl +++ b/docker/terraform/build.pkr.hcl @@ -4,15 +4,24 @@ variable "image_tag" { default = env("IMAGE_TAG") } -source "docker" "autogenerated_1" { - changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] - commit = true - image = "toolisticon/base-builder-image" - pull = false +source "docker" "amd64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/amd64" +} + +source "docker" "arm64" { + changes = ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"] + commit = true + image = "toolisticon/base-builder-image" + pull = false + platform = "linux/arm64" } build { - sources = ["source.docker.autogenerated_1"] + sources = ["source.docker.amd64", "source.docker.arm64"] provisioner "ansible" { extra_arguments = ["-v"]