Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.33 KB

README.md

File metadata and controls

68 lines (49 loc) · 1.33 KB

Devcontainer snippets and helpful tips

Install various software from source code or precompiled binaries


Create a persistent home directory to maintain personal configuration between new instances of the devcontainer by mounting a docker volume as the home directory.


Orchestrate multiple containers to create a complex development environment using docker-compose;


Mount a unique out of source build directory so that repositories in the same host directory do not conflict.

  "mounts": [
    "source=${localWorkspaceFolder}/../${localWorkspaceFolderBasename}-build,target=/workspaces/build,type=bind,consistency=delegated",
  ],

If you need to use a ptrace based debugger for C++, Go, Rust, etc.

  "runArgs": [
    "--cap-add=SYS_PTRACE",
    "--security-opt",
    "seccomp=unconfined",
  ]

If you need access to host docker from inside the container

  "runArgs": [
    "--privileged",
    "-v",
    "/var/run/docker.sock:/run/docker.sock",
  ]

If you need your container on a special docker network

  "runArgs": [
    "--network=<name>",
  ]

If you have a local X11 server and want to run a graphical application inside the container

export DISPLAY=host.docker.internal:0.0