How to archive artifacts for images w/out a shell?...
# 🌱|help-and-getting-started
d
If the image being tested is based on a distroless-type image with no shell, artifact archival fails with an error about it. (I assume this is because it's trying to do a
kubectl cp
or similar) Is there any workaround for this?
c
Hi @dry-library-47365, my apologies for this late reply, somehow this thread fell through the cracks. 😦 Yes, you are correct, we exec into the running pod and usually we expect
sh
to be present. This is not a common use-case in our current user-base, but definitely a valid feature request. It would be great if you could open an issue on GitHub. Meanwhile, we could think of a workaround. Would it be feasible for your test case, to use a different base-image just for testing and/or CI? You could create a multi-stage image and specify via Garden which one to use based on the environment you are in. Or even specify a different image altogether. E.g.:
Copy code
# Select stage based on environment
kind: Build
name: api-dev
type: container

spec:
  dockerfile: api.dockerfile
  targetStage: ${environment.name === 'dev' ? "dev-stage" : "prod-stage" }
See docs for more info: https://docs.garden.io/reference/template-strings/action-specs#usd-environment.name and https://docs.garden.io/reference/action-types/build/container#spec.targetstage I hope this helps in the meantime.
2 Views