Skip to content

Very close to being able to run devcontainers (at least in VSCode) #139

@djmcgreal

Description

@djmcgreal

Hi, and thanks for Kubedock.

I had the idea it might be possible to run devcontainers against Kubernetes with it. This would be really great because it gives a smoother experience than other tools with emulation at the kubernetes level.

I had to:

  • Avoid anything trying to build the container through Kubedock (though would be really cool to have that implemented via e.g. Kaniko!)
    • Prebuild the container with devcontainer build
    • Create an override-devcontainer.json that just changes the image to the one that's already built
    • Launch the devcontainer with devcontainer up --workspace-folder . --override-config override-devcontainer.json
    • Launch vscode with DOCKER_HOST
  • Add some missing support to kubedock
    • Pretend to have implemented docker api version 1.35 and implement exec --workdir
    • Implement handling of exec --env
    • Introduce a fake Mounts entry for docker inspect. It didn't matter greatly that volume mounts aren't supported as long as I faked the one in the output of docker inspect that it was expecting. I wonder how difficult it would be to support these kinds of mounts with PVCs more properly.

I'm not getting the /workspaces/ copied across though. Did I misinterpret how that works? I was expecting kubedock to copy over the source as part of an init container step, but that doesn't seem to be happening here.

Thanks,
Dan.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions