Marcus Stade
Marcus Stade

Reputation: 4994

Can a packer builder depend on another builder?

I am building a development environment for use with Vagrant, and it's working really well at the moment but from time to time I need to make some minor changes that aren't really part of the base system setup. So to speed up build times and iteration, I'd like to split my build into two, run in order:

  1. Base image (OS, common tooling, configuration, etc.)
  2. Vagrant specifics (developer tools, user configuration, etc.)

The former won't change very often, but the latter does. I'm using the VirtualBox builder, but I can't seem to figure out how to make one builder dependent on another – is this possible?

Upvotes: 2

Views: 2203

Answers (1)

m1keil
m1keil

Reputation: 4575

No, there's no builder dependency mechanism in Packer.

However since you can control what builder will run the build process, you can create simple wrapper script that will allow you to create the flow process you need.

So builder A will create base box and place final product in /path and builder B will use virtualbox image from /path as it's base to final Vagrant box. Your wrapper script should be the glue between builder A and builder B.

Upvotes: 5

Related Questions