Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local filesystem for the context #35

Open
ixolt opened this issue Feb 21, 2024 · 1 comment
Open

local filesystem for the context #35

ixolt opened this issue Feb 21, 2024 · 1 comment

Comments

@ixolt
Copy link

ixolt commented Feb 21, 2024

Hello there,
I am trying to use provider for cases where I am not using git for context but local folder, and seems like this doesn't work
tried that multiple times with different variations

  context     = "${path.cwd}/${path.module}/"
  dockerfile  = "${path.cwd}/${path.module}/dockerfile"
  context     = "${path.cwd}/${path.module}/"
  dockerfile  = "dockerfile"
  context     = "./${path.module}/"
  dockerfile  = "dockerfile"

etc..

Can you please help me with that or add one more example of using the local file system for the kaniko_image resource?

@gitlawr
Copy link
Collaborator

gitlawr commented Feb 22, 2024

From kaniko:

Note about Local Directory: this option refers to a directory within the kaniko container. If you wish to use this option, you will need to mount in your build context into the container as a directory.

Under the hood, this provider creates a kubernetes job to do the build. For local dir case, we need to make volumes of the pod configurable then mount the build context into the pod. It's not feasible at the moment. If you are interested in hacking see implementation in https://github.com/seal-io/terraform-provider-kaniko/blob/main/kaniko/common.go#L179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants