GCE Auth for Packer running in docker

14 views
Skip to first unread message

da...@pex.com

unread,
Dec 7, 2018, 12:19:07 PM12/7/18
to Packer
Hi

I'm trying to get GCE Authentication working with packer inside a docker container.  Currently, I'm creating a build container based on Debian 9.4 and to this container I add packer and gcloud.  The installs go fine as does the gcloud init.  But, the only way I get 'packer build' commands to succeed is if I use -var account_file=path/to/my/service_account.json on the command line too.  I'd like to set things up in my container to not require passing the account file location in on command line or to hard code the path to the file in my packer.json config file.  I know this is possible, as it works on my laptop and other places, but for some reason not in docker.  Any suggestions?

Thanks,
Dave

Rickard von Essen

unread,
Dec 7, 2018, 5:11:24 PM12/7/18
to packe...@googlegroups.com

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/9b8e5d66-5e71-4884-9af8-03a92a99980e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

da...@pex.com

unread,
Dec 10, 2018, 4:36:37 PM12/10/18
to Packer
Hi Rickard,

Thanks for the reply.  I have been through that page, and I've tried those various ways to setup auth.  As it turned out I was using a very old version of packer from Debian stretch repos.  As soon as I grabbed the newest version I was able to see that I needed to add the service account user to my users IAM.  After that it works as expected using the environmental vars to point to the service account key file.

-Dave
Reply all
Reply to author
Forward
0 new messages