Skip to content

Commit

Permalink
feat(Packer): Use latest Packer
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Reinhardt committed May 1, 2022
1 parent d8be3eb commit da17b6a
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 111 deletions.
1 change: 1 addition & 0 deletions .bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tagImages() {
docker tag toolisticon/terraform-builder:${1} toolisticon/terraform-builder:${2}
docker tag toolisticon/nodejs-builder:${2} toolisticon/nodejs-builder:${2}
docker tag toolisticon/openjdk11-builder:${1} toolisticon/openjdk11-builder:${2}
docker tag toolisticon/openjdk17-builder:${1} toolisticon/openjdk17-builder:${2}
}

prepareAndBuildAndTag () {
Expand Down
56 changes: 34 additions & 22 deletions docker/_base/build.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
{
"builders": [{
"type": "docker",
"image": "buildpack-deps:latest",
"pull": true,
"commit": true,
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
]
}],
"provisioners":[{
"type": "ansible",
"user": "root",
"playbook_file": "ansible/playbook.yml",
"extra_arguments": [ "-v" ]
}
],
"post-processors": [[ {
"type": "docker-tag",
"builders": [
{
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
],
"commit": true,
"image": "buildpack-deps:latest",
"pull": true,
"type": "docker"
}
],
"post-processors": [
[
{
"repository": "toolisticon/base-builder-image",
"tag": "latest"
} ]]
"tags": [
"latest"
],
"type": "docker-tag"
}
]
],
"provisioners": [
{
"extra_arguments": [
"-v"
],
"playbook_file": "ansible/playbook.yml",
"type": "ansible",
"user": "root"
}
]
}

43 changes: 26 additions & 17 deletions docker/ansible/build.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
},
"builders": [
{
"type": "docker",
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
],
"commit": true,
"image": "toolisticon/base-builder-image",
"pull": false,
"commit": true,
"changes": ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"]
}
],
"provisioners": [
{
"type": "ansible",
"user": "root",
"playbook_file": "ansible/playbook.yml",
"extra_arguments": ["-v"]
"type": "docker"
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "toolisticon/ansible-builder",
"tag": "{{user `image_tag`}}"
"tags": [
"{{user `image_tag`}}"
],
"type": "docker-tag"
}
]
]
],
"provisioners": [
{
"extra_arguments": [
"-v"
],
"playbook_file": "ansible/playbook.yml",
"type": "ansible",
"user": "root"
}
],
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
}
}

43 changes: 26 additions & 17 deletions docker/java/openjdk11.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
},
"builders": [
{
"type": "docker",
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
],
"commit": true,
"image": "toolisticon/base-builder-image",
"pull": false,
"commit": true,
"changes": ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"]
}
],
"provisioners": [
{
"type": "ansible",
"user": "root",
"playbook_file": "ansible/openjdk11.yml",
"extra_arguments": ["-v"]
"type": "docker"
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "toolisticon/openjdk11-builder",
"tag": "{{user `image_tag`}}"
"tags": [
"{{user `image_tag`}}"
],
"type": "docker-tag"
}
]
]
],
"provisioners": [
{
"extra_arguments": [
"-v"
],
"playbook_file": "ansible/openjdk11.yml",
"type": "ansible",
"user": "root"
}
],
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
}
}

43 changes: 26 additions & 17 deletions docker/java/openjdk17.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
},
"builders": [
{
"type": "docker",
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
],
"commit": true,
"image": "toolisticon/base-builder-image",
"pull": false,
"commit": true,
"changes": ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"]
}
],
"provisioners": [
{
"type": "ansible",
"user": "root",
"playbook_file": "ansible/openjdk17.yml",
"extra_arguments": ["-v"]
"type": "docker"
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "toolisticon/openjdk17-builder",
"tag": "{{user `image_tag`}}"
"tags": [
"{{user `image_tag`}}"
],
"type": "docker-tag"
}
]
]
],
"provisioners": [
{
"extra_arguments": [
"-v"
],
"playbook_file": "ansible/openjdk17.yml",
"type": "ansible",
"user": "root"
}
],
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
}
}

4 changes: 2 additions & 2 deletions docker/nodejs/ansible/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
nodejs_version: "14.x"
nvm_node_version: "16.5.0"
nodejs_version: "16.x"
nvm_node_version: "16.5.0"
43 changes: 26 additions & 17 deletions docker/nodejs/build.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
},
"builders": [
{
"type": "docker",
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
],
"commit": true,
"image": "toolisticon/base-builder-image",
"pull": false,
"commit": true,
"changes": ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"]
}
],
"provisioners": [
{
"type": "ansible",
"user": "root",
"playbook_file": "ansible/playbook.yml",
"extra_arguments": ["-v"]
"type": "docker"
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "toolisticon/nodejs-builder",
"tag": "{{user `image_tag`}}"
"tags": [
"{{user `image_tag`}}"
],
"type": "docker-tag"
}
]
]
],
"provisioners": [
{
"extra_arguments": [
"-v"
],
"playbook_file": "ansible/playbook.yml",
"type": "ansible",
"user": "root"
}
],
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
}
}

4 changes: 2 additions & 2 deletions docker/nodejs/roles/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- src: geerlingguy.nodejs
version: "5.0.0"
version: "6.0.0"

- src: stephdewit.nvm
version: "v3.2.0"
version: "v3.3.0"
43 changes: 26 additions & 17 deletions docker/terraform/build.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
},
"builders": [
{
"type": "docker",
"changes": [
"VOLUME /data",
"WORKDIR /data",
"ENTRYPOINT /bin/bash"
],
"commit": true,
"image": "toolisticon/base-builder-image",
"pull": false,
"commit": true,
"changes": ["VOLUME /data", "WORKDIR /data", "ENTRYPOINT /bin/bash"]
}
],
"provisioners": [
{
"type": "ansible",
"user": "root",
"playbook_file": "ansible/playbook.yml",
"extra_arguments": ["-v"]
"type": "docker"
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "toolisticon/terraform-builder",
"tag": "{{user `image_tag`}}"
"tags": [
"{{user `image_tag`}}"
],
"type": "docker-tag"
}
]
]
],
"provisioners": [
{
"extra_arguments": [
"-v"
],
"playbook_file": "ansible/playbook.yml",
"type": "ansible",
"user": "root"
}
],
"variables": {
"image_tag": "{{env `IMAGE_TAG`}}"
}
}

0 comments on commit da17b6a

Please sign in to comment.