hashicorp / packer-plugin-docker

Packer plugin for Docker Builder
https://www.packer.io/docs/builders/docker
Mozilla Public License 2.0
30 stars 26 forks source link

log output of docker communicator commands #17

Open ghost opened 3 years ago

ghost commented 3 years ago

This issue was originally opened by @gfx as hashicorp/packer#4935. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


I use packer to build Docker images. packer build ... on local Mac succeeds but it fails on Circle CI 2.0, even there're some cases that it fails with cirlceci CLI.

Unfortunately, the error logs have no information about it. How can I debug it?


packer version: 1.0.0 Host platform: Docker (image base: amazonlinux:latest) logs:

2017/05/26 05:35:52 ui:     docker: Container ID: 309cb52e190e2d07d6d5a6ed5f793d477ee8555c6473cb64fefa80ead705667c
    docker: Container ID: 309cb52e190e2d07d6d5a6ed5f793d477ee8555c6473cb64fefa80ead705667c
2017/05/26 05:35:53 packer: 2017/05/26 05:35:53 Running the provision hook
2017/05/26 05:35:53 ui: ==> docker: Uploading foo.txt => /
==> docker: Uploading foo.txt => /
2017/05/26 05:35:53 packer: 2017/05/26 05:35:53 [INFO] 0 bytes written for 'uploadData'
2017/05/26 05:35:53 [INFO] 0 bytes written for 'uploadData'
2017/05/26 05:35:53 packer: 2017/05/26 05:35:53 Executing docker exec -i 309cb52e190e2d07d6d5a6ed5f793d477ee8555c6473cb64fefa80ead705667c /bin/sh -c (command cp /packer-files/upload756830470 /foo.txt):
2017/05/26 05:35:53 ui error: ==> docker: Upload failed: Upload failed with non-zero exit status: 1
==> docker: Upload failed: Upload failed with non-zero exit status: 1
2017/05/26 05:35:53 ui: ==> docker: Killing the container: 309cb52e190e2d07d6d5a6ed5f793d477ee8555c6473cb64fefa80ead705667c
==> docker: Killing the container: 309cb52e190e2d07d6d5a6ed5f793d477ee8555c6473cb64fefa80ead705667c
2017/05/26 05:35:55 ui error: Build 'docker' errored: Upload failed with non-zero exit status: 1
2017/05/26 05:35:55 Builds completed. Waiting on interrupt barrier...
2017/05/26 05:35:55 machine readable: error-count []string{"1"}
2017/05/26 05:35:55 ui error: 
==> Some builds didn't complete successfully and had errors:

(see https://circleci.com/gh/gfx/packer-on-docker-on-circleci2/3 for all the logs)

Reproducable example: https://github.com/gfx/packer-on-docker-on-circleci2