Closed solesensei closed 6 months ago
Hi @solesensei, we're now building the workspace directly in the pod instead of on the users machine like before, which is why there are no BuildKit options anymore. The new flow for this is using prebuilds, the piece you're missing in your setup is only step 1:
Specify a prebuild customization in your devcontainer.json
:
...
"customizations": {
"devpod": {
"prebuildRepository": "ghcr.io/my-org/my-repo"
}
}
Build the prebuild image locally or in a CI Pipeline devpod build github.com/my-org/my-repo --repository ghcr.io/my-org/my-repo
Create the workspace using the kubernetes provider. If there is a prebuild match it'll prefer that over building from source
Hi @pascalbreuninger, thanks for the clarification!
So if I understood correctly the point 2. there is no way to build&push on Kubernetes itself.
What kind of CI pipeline can you recommend? Do you mean Github Actions with some devpod action?
As far as I remember buildkit can build your image on a temporary buildkit pod and then push it to the image registry. Are there any specific reasons why you have stopped supporting it?
I'm interested because I'm looking for remote image building solutions.
As far as I remember buildkit can build your image on a temporary buildkit pod and then push it to the image registry. Are there any specific reasons why you have stopped supporting it?
Yes, we wanted to get rid of the requirement to have a registry configured. Now we use Kaniko to build and start in the same pod, without the necessity to push the image anywhere
As for
What kind of CI pipeline can you recommend? Do you mean Github Actions with some devpod action?
We were thinking about writing a github action to make that easier, generally any CI solution that supports docker should suffice. The basic steps there would be, for example triggered by changes to the .devcontainer
folder:
docker login ghcr.io
(or whatever you use)curl -L -o devpod "https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod
devpod provider add docker
devpod build github.com/my-org/my-repo --repository ghcr.io/my-org/my-repo --provider docker
Hey there! 👋
I'm currently setting up workspace builds.
Previously, I was able to use
BUILD_REPOSITORY
andBUILDKIT
options to build (on kubernetes) and push an image to some image registry. This way, I could avoid rebuilding my workspace each time I launched it. However, it seems that now the only method available is to use thedevpod build
command and prebuild workspaces, but this approach is limited to thedocker
driver and my laptop, not the kubernetes.So, my main question is: What's the current recommended approach for building and saving workspaces and is it possible to do so on Kubernetes?