Skip to content

Conversation

@aluki
Copy link

@aluki aluki commented May 30, 2016

I'm getting this error when trying to use the post processor:

  • Post-processor failed: Could not parse docker build output: sha256:7d57f6744acb75e0a5ad3939844d5970604b60940d016bb4a540a44eeafea8a7

Looks like the "docker build" command has changed the message it shows after building the image. So I've tried with a new regexp. I used (?:sha256:)? to match image ids composed only of hexadecimal digits. It is only a safety measure... I haven't tested it with previous versions of docker.

This change works for me with docker 1.11.0:

==> docker: Running post-processor: docker-dockerfile
docker (docker-dockerfile): Base image ID: sha256:c3949b417727055a20c1ea7e143172b30f467ca80e051cebf9781bbf711c2c03
docker (docker-dockerfile): Image ID: sha256:7f539c23418e440ad64a78d564f8073f5a563843beaf1a36435fde27afca032a

@gregorskii
Copy link

gregorskii commented Aug 25, 2016

+1 this is an issue for me.

Docker: Version 1.12.0-a (build: 11213)

Adding the above fix does not appear to fix it:

Build 'docker' errored: 2 error(s) occurred:

* Post-processor failed: Could not parse `docker build` output: sha256:8e752a3a8e9002cc4c4ee05ae5d79e292d7e22c0d4e965d0cd76f4fc9bfd96d9

* Error destroying builder artifact: reading body [pos 352]: cannot decode non-nil codec value into nil error (1 methods)

==> Some builds didn't complete successfully and had errors:
--> docker: 2 error(s) occurred:

* Post-processor failed: Could not parse `docker build` output: sha256:8e752a3a8e9002cc4c4ee05ae5d79e292d7e22c0d4e965d0cd76f4fc9bfd96d9

* Error destroying builder artifact: reading body [pos 352]: cannot decode non-nil codec value into nil error (1 methods)

==> Builds finished but no artifacts were created.

@gregorskii
Copy link

Actually this works for me if I edit the file in the GOPATH after running go get.

Must be my misunderstanding of GO, but this was the process I did:

git clone git@github.com:jgkim/packer-post-processor-docker-dockerfile.git
cd packer-post-process-docker-dockerfile
go get -d ./...
go build

Any edits to the files in the checked out path were not applied on go build. I had to edit the files in the GOPATH:

export GOPATH="$HOME/go/jgkim..."

@abessifi
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants