{
"name": "mc-rtc-superbuild-jammy-build",
"build": {
"dockerfile": "Dockerfile",
"context": "../../..",
"options": [
"--ssh default"
]
},
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}",
},
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/docker-ws/mc-rtc-superbuild-jammy,target=/home/vscode/workspace,type=bind,consistency=cached"
],
"features":
{
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/duduribeiro/devcontainer-features/neovim:1.0.1": {},
"ghcr.io/devcontainers/features/github-cli": { "version": "latest" },
"ghcr.io/georgofenbeck/features/lazygit-linuxbinary:1": { "version": "latest" }
},
"customizations": {
"vscode": {
"extensions": [
"twxs.cmake",
"ms-vscode.cmake-tools",
"josetr.cmake-language-support-vscode",
"ms-vscode.cpptools",
"ms-vscode.docker",
"ms-vscode.cpptools-extension-pack",
"ms-vscode-remote.remote-containers",
"ms-python.python",
"GitHub.vscode-github-actions"
]
}
},
"postCreateCommand": "~/superbuild/.devcontainer/setupShell.sh",
"runArgs": [
"--network=host",
],
"remoteUser": "vscode",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/superbuild,type=bind",
"workspaceFolder": "/home/vscode/superbuild"
}
I have a Dockerfile that needs to pull private git repositories at build time. I tried to forward the ssh-agent using
In conjuction with
RUN --mount=type=sshin the docker file.Doing
docker build --ssh default .works as expected (including the ssh-agent forwarding).
However doing
devcontainer build --workspace-folder . --config devcontainer.jsonFails with the following output:
unknown flag: --ssh defaultWhat's odd is that if I take the exact command that devcontainer-cli is running above and run it manually in the same terminal, everything works as expected:
For good measure here is the devcontainer.json file
What's going on here? My guess is something related to buildkit environment somehow being different when running from within the devcontainer-cli's node?
If I replace `--ssh default` with `--help` instead, it indeed seems to exist:
Thanks in advance for your help, and thanks for the project!