hashicorp / hashicorp/packer-plugin-docker

Failed to upload to 'xxx' in container: Error response from daemon: Error processing tar file(exit status 1): chtimes <yyy>: no such file or directory

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
bug builder/docker
Dominant language
Go
Stars
40
Forks
29
PR merge metrics
No merged PRs in 30d

Description

_This issue was originally opened by @brikis98 as hashicorp/packer#6103. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._


I have a Packer template that I'm using to build Docker images. Here's the rough idea of what the template looks like:

```json
{
"builders": [{
"name": "ubuntu-docker",
"type": "docker",
"image": "gruntwork/ubuntu-test:16.04",
"commit": true,
"run_command": ["-d", "-i", "-t", "{{.Image}}", "/sbin/init"],
"privileged": true,
"volumes": {
"/sys/fs/cgroup": "/sys/fs/cgroup"
}
}],
"provisioners": [{
"type": "file",
"source": "{{template_dir}}/../../../my-folder-name",
"destination": "/tmp"
},{
"type": "shell",
"inline": [
"/tmp/some-script.sh"
]
}],
"post-processors": [{
"type": "docker-tag",
"repository": "gruntwork/my-container",
"tag": "latest",
"only": ["ubuntu-docker"]
}]
}
```

When I run `packer build` locally (on my Mac), the Docker container builds just fine. However, when I run my automated tests in CircleCI, which also call `packer build`, I see an error like this:

```
Failed to upload to '/tmp' in container: Error response from daemon: Error processing tar file(exit status 1): chtimes /my-folder-name/_docs: no such file or directory
```

The `/my-folder-name/_docs` folder definitely exists. The exact file/folder it fails on seems to change from run to run.

A few key notes:

- I was originally running Packer builds in parallel, so I tried setting different [PACKER_TMP_DIR](https://www.packer.io/docs/builders/docker.html#overriding-the-host-directory) values for each one. However, that didn't help, and upon further testing, the error happens even if the builds run sequentially.
- Packer version: v1.2.2
- Platform: CircleCI (Ubuntu 14.04)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.