Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Docker file to build packer binaries.
This image build on top of the official golang image,
and follows the steps described in the
packer docs

Build the images

The usual steps:

git clone https://github.com/lalyos/docker-packer.git
cd docker-packer
docker build -t packer .

Usage

The image uses:

  • /data volume as working dir
  • /go/bin/packer as entrypoint
  • environment variables for authentication

So if you want to validate a packer.json file in the current dir,
which uses amazon-ebs builder:

docker run -it \
  -v $(pwd):/data \
  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
  packer validate /data/packer.json

If you use for example the atlas postprocessor, add a new environment valirable:

-e ATLAS_TOKEN=$ATLAS_TOKEN

alias

You can make life easier by aliasing the docker run <OPTIONS> packer

alias packer='docker run -t -v $(pwd):/data -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e ATLAS_TOKEN=$ATLAS_TOKEN  packer'

this way you can use the patched packer version as easy as:

$ packer version

Packer v0.7.5.dev (8fea99151657f1c36b4e13b190eb15acca248592+CHANGES)

tl;dr

Packer has some issues,
when using the amazon-ebs builder against:

  • eu-central-1
  • cn-north-1

The 2 new region uses the latest v4 signature algorithm for ec2. Packer uses
the goamz library which doesn't yet switched
for the latest sign algorythm.

There is an open pull request which
is used to fix packer.

Docker Pull Command
Owner
lalyos
Source Repository

Comments (0)