3

Is there anyone out there who is using this project?

I would love to see a full working template file, and they claim that this is enough to get it running:

{
  "type": "docker",
  "image": "debian",
  "export_path": "image.tar"
}

Howerver, when I build that, I get the following errors:

packer build simple-ubuntu.template  
  Failed to parse template: 4 error(s) occurred:

  * Unknown root level key in template: 'export_path'
  * Unknown root level key in template: 'image'
  * Unknown root level key in template: 'type'
  * No builders are defined in the template.

What I really need is a template which uses one of my existing images on the host as a base image:

testdocker/version4                 latest              3dc6d92bc373        2 weeks ago         627.9 MB

It would then read in couple of parameters from the user (hostname, IP, email address, etc...), run a shell script to do the modification (you can call provisioning) on the files, and finally outputs a downloadable and importable Docker image.

It's very important to note that I don't want the base image to be modified.

GregL
  • 9,870
zino
  • 43

1 Answers1

4

We use Packer (although for VMware and AWS, not Docker) and find it very useful. You need a bit more to get a basic example to work though, something like:

{
  "builders": [
    {
      "type": "docker",
      "image": "debian",
      "export_path": "image.tar"
    }
  ]
}

I'd recommend running through their intro guide at https://www.packer.io/intro. It uses AWS, but the concepts should transfer to the other builders.

mvermaes
  • 671