Re: [packer] Packer can't find user when run from within container

1,076 views
Skip to first unread message
Message has been deleted

Rickard von Essen

unread,
Feb 27, 2017, 4:05:08 PM2/27/17
to packe...@googlegroups.com
Could you provide some more context here? Give us a example packer template (.json) and what do you mean with a container ? a docker container, if so can you specify the command you started it with.

It might just be that env var USER is not set. If I run: docker run -it ubuntu:trusty bash  USER is not set. You could just define it. 

// Rickard

On 27 February 2017 at 21:28, Katie Paugh <katie...@gmail.com> wrote:
Trying to run packer inside of a Container. I keep getting the error:
* user: could not determine current user from environment.


It runs fine from the host that manages the Container but I get the error when running within the Container.

Any ideas? Can I define the user? 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/367851ee-7cd9-4a0c-a664-f2138beaed71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Katie Paugh

unread,
Feb 27, 2017, 4:18:20 PM2/27/17
to Packer
Welp, accidentally deleted original post. 
But I figured out the issue. I'm running a Jenkins server in a Docker Container. 
Was getting an issue where packer wouldn't run but setting the user variable while root fixed the issue. 
Not sure why Jenkins is running as root but thats a different issue.

Thanks!


On Monday, February 27, 2017 at 4:05:08 PM UTC-5, Rickard von Essen wrote:
Could you provide some more context here? Give us a example packer template (.json) and what do you mean with a container ? a docker container, if so can you specify the command you started it with.

It might just be that env var USER is not set. If I run: docker run -it ubuntu:trusty bash  USER is not set. You could just define it. 

// Rickard
On 27 February 2017 at 21:28, Katie Paugh <katie...@gmail.com> wrote:
Trying to run packer inside of a Container. I keep getting the error:
* user: could not determine current user from environment.


It runs fine from the host that manages the Container but I get the error when running within the Container.

Any ideas? Can I define the user? 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Rickard von Essen

unread,
Feb 28, 2017, 12:20:55 AM2/28/17
to packe...@googlegroups.com
If you start docker there is a option -u <user> to select the user the process in the container will use. If not specified it will check if there is one defined in the image (with USER) if not default to root. 

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/1be5ec3e-2bf9-44b8-b329-64fadd45f39d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages