Using runner image with pre-downloaded providers #321
artem-nefedov
started this conversation in
Show and tell
Replies: 1 comment
-
Thank you for sharing! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just wanted to share my experience of creating runner image with pre-downloaded providers on a filesystem mirror, so people can avoid having same problems. Reasons why you may want to use pre-downloaded providers: security/compliance, network limitations, startup performance, etc.
Originally, I just built the image and put
.terraformrc
with "provider_installation" section into "/home/runner". Testing it just by runningterraform init
inside the image seemed to work (as seen byInstalled ... (unauthenticated)
messages). However, during the actual runner pod execution when applying Terraform resource, providers were still downloaded from the internet. Turns out, the reason is the fact that runner Pod manifest overrides existing "/home/runner" by mountingemptyDir
volume there.The solution I came up with is generating
.terraformrc
at startup.Below is the whole setup (it also changes
terraform
executable version):terraform providers mirror
command)Beta Was this translation helpful? Give feedback.
All reactions