From 279e6658ac0a907e5c2a543d3d11062ba4a85a48 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Wed, 13 Dec 2023 10:17:23 +0100 Subject: [PATCH] Add devcontainer configuration We already have everything needed to work inside a container, with this configuration file developing in moby is even easier: the IDE will ask you if you want to run everything inside a container and set it up for you. No need to know that you have to run "BIN_DIR=. make shell" any more. Signed-off-by: Djordje Lukic --- .devcontainer/devcontainer.json | 13 +++++++++++++ docs/contributing/set-up-dev-env.md | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..3069f3802f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "name": "moby", + "build": { + "context": "..", + "dockerfile": "../Dockerfile", + "target": "dev" + }, + "workspaceFolder": "/go/src/github.com/docker/docker", + "workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/docker/docker,type=bind,consistency=cached", + + "remoteUser": "root", + "runArgs": ["--privileged"] +} diff --git a/docs/contributing/set-up-dev-env.md b/docs/contributing/set-up-dev-env.md index b3bcb2fb88..c4cd43b335 100644 --- a/docs/contributing/set-up-dev-env.md +++ b/docs/contributing/set-up-dev-env.md @@ -136,6 +136,8 @@ can take over 15 minutes to complete. At this point, your prompt reflects the container's BASH shell. + Alternatively you can use the provided devcontainer in an IDE that supports them (VSCode, Goland, etc.) + 5. List the contents of the current directory (`/go/src/github.com/docker/docker`). You should see the image's source from the `/go/src/github.com/docker/docker`