I'm using github codespaces and I have pre-built my devcontainer with feature kubernetes-helm-minikube which contains a minikube pre-installed in the dev container.
My question is, with prebuilding, my devcontainer users still have to download gcr.io/k8s-minikube/kicbase
image when they run minikube start
in a newly created codespace. Is there a way to cache the minikube start
resources in the prebuild process? Or at least cache the gcr.io/k8s-minikube/kicbase image with prebuild?
Could anyone point out the right way to do that? Greatly appreciate any suggestions.
What I've tried:
I've read docs in: https://docs.github.com/en/codespaces/prebuilding-your-codespaces/configuring-prebuilds and https://containers.dev/implementors/json_reference/#_lifecycle-scripts
I tried run
minikube start
on container create:
"onCreateCommand": [
"nohup bash -c 'minikube start &' > minikube.log 2>&1"
]
and the prebuild workflow failed with error $ nohup bash -c 'minikube start &' > minikube.log 2>&1 OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "nohup bash -c 'minikube start &' > minikube.log 2>&1": executable file not found in $PATH: unknown
I tried run
docker pull gcr.io/k8s-minikube/kicbase:v0.0.36
on container create and similar error occurred:starting container process caused: exec: "docker pull gcr.io/k8s-minikube/kicbase:v0.0.36": stat docker pull gcr.io/k8s-minikube/kicbase:v0.0.36: no such file or directory: unknown
I tried run
minikube start
withpostCreateCommand
and the result made it clear that thepostCreateCommand
is only executed after the dev container has been assigned to a user, not during prebuild (as the prebuild doc states).