Skip to content

Docker builder documentation is incorrect (fix_upload_owner) #64

Open

Description

@hc-github-team-packer

This issue was originally opened by @boblechat in hashicorp/packer#11187 and has been migrated to this repository. The original issue description is below.


Overview of the Issue

Building a docker image from a base image running with a non root user always causes a "Permission denied" in shell provisioners.
Documentation clearly states that the fix_upload_owner is set to true by defaut, which is incorrect. You have to set it explicitely!
Also, could you clarify what "the owner will depend on the version of docker installed in the system" means? That's gibbersih to me.

Reproduction Steps

To make it fail:

To make it work;

Packer version

1.7.4

Simplified Packer Buildfile

gist is here

Operating system and Environment details

Irrelevant here

Log Fragments and crash.log files

When it fails:

==> agent.docker.alm: Using docker communicator to connect: 172.17.0.2
==> agent.docker.alm: Provisioning with shell script: C:\Users\me\AppData\Local\Temp\packer-shell381356875
==> agent.docker.alm: sh: 1: /tmp/script_120.sh: Permission denied
==> agent.docker.alm: Provisioning step had errors: Running the cleanup provisioner, if present...

When it works:

==> agent.docker.alm: Using docker communicator to connect: 172.17.0.2
==> agent.docker.alm: Provisioning with shell script: C:\Users\me\AppData\Local\Temp\packer-shell892913999
    agent.docker.alm: Hello from Hell!
==> agent.docker.alm: Committing the container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions