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,030
  • 2
  • 24
  • 35
zino
  • 43
  • 1
  • 4

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
  • 5
  • 7
  • Thank it was useful, but if I put in "testdocker/version4" I get: not found" ==> docker: Error pulling Docker image: Bad exit status: 1 Build 'docker' errored: Error pulling Docker image: Bad exit status: 1 How can I tell it to get this image from the local repo instead of trying to pull it from remote registry? – zino Mar 26 '15 at 15:02
  • Have you tried using "pull": "false" as mentioned at https://www.packer.io/docs/builders/docker.html? It sounds like it might do what you need. – mvermaes Mar 26 '15 at 15:34