Packer to Create Docker
It is simple to create Docker from Packer. In this example I will show you how to create open JDK 8 installed Docker image. First you have to create a packer.json file: { "builders": [ { "name": "docker", "type": "docker", "image": "centos:7", "commit": true } ], "provisioners": [ { "type": "ansible", "playbook_file": "playbook.yaml" } ], "post-processors": [ { "type": "docker-tag", "repository": "ojitha/java8", "tag": "0.0.1" } ] } Here the playbook.yaml which will provision the docker instance: --- - hosts: all tasks: - name: message debug: msg="Container - {{ inventory_hostname }} running {{ ansible_distribution }}" - name: install the latest version of open jdk...