envbuilder icon indicating copy to clipboard operation
envbuilder copied to clipboard

Fallback not working when invalid Dockerfile in coder workspace

Open ghost opened this issue 1 year ago • 4 comments

When I use devcontainer in coder (kubernetes) from this template:

template_workspace_coder.txt

And change the Dockerfile to this and restart: Dockerfile: INVALID FROM qmcgaw/godevcontainer

Then envbuilder is not detecting the failure and is not reverting to the fallback image image

image

ghost avatar Sep 28 '24 16:09 ghost

I can confirm, this behavior does in fact not match our documentation. This should only happen when exit on build failure is used but that's not the case. There are multiple code paths where we end up returning an error instead of using the fallback image.

We'll need to refactor the fallback logic to fix this.

mafredri avatar Sep 30 '24 09:09 mafredri

Maybe also make it that from the coder ui like with templates, so one can edit the devcontainer.json directly from there. So one could make changes faster if it doesn't work.

ghost avatar Oct 03 '24 15:10 ghost

@datapedd I'm not sure what you're askin. Are you asking to be able to provide devcontainer.json contents as e.g. an base64-encoded environment variable?

ENVBUILDER_DEVCONTAINER_JSON_BASE64=eyJpbWFnZSI6InVidW50dTpsYXRlc3QifQo=

That's certainly one way we could support the use-cases of plumbing the JSON through from the template to envbuilder.

mafredri avatar Oct 03 '24 15:10 mafredri

no just when the build failed that one can still change the devcontainer.json from coder ui. Or just make it that this case does not happen that if a build fails one can always fallback to a image where i then can change the devcontainer.json

ghost avatar Nov 12 '24 19:11 ghost