VSCode + Dev Containers are a great way to create custom environments without modifying our actual system.

They provide a consistent development environment, ensure dependencies are managed correctly, and make it easy to share setups with your team.

Here are some configurations you can use to create them.

Vapor#

{
    "name": "Swift",
    "image": "swift:latest",
    "features": {
        "ghcr.io/devcontainers/features/common-utils:2": {
            "installZsh": "false",
            "username": "vscode",
            "userUid": "1000",
            "userGid": "1000",
            "upgradePackages": "false"
        },
        "ghcr.io/devcontainers/features/git:1": {
            "version": "os-provided",
            "ppa": "false"
        }
    },
    "runArgs": [
        "--cap-add=SYS_PTRACE",
        "--security-opt",
        "seccomp=unconfined"
    ],
    "customizations": {
        "vscode": {
            "settings": {
                "lldb.library": "/usr/lib/liblldb.so"
            },
            "extensions": [
                "sswg.swift-lang",
                "streetsidesoftware.code-spell-checker"
            ]
        }
    },
    "remoteUser": "root",
    "postCreateCommand": "apt-get update && apt-get install -y libssl-dev libsqlite3-dev zlib1g-dev make && rm -rf toolbox && git clone https://github.com/vapor/toolbox.git && cd toolbox && make install && cd .. && rm -rf toolbox"
}

Scala#

{
	"name": "Scala",
	"image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye",

	"features": {
		"ghcr.io/devcontainers/features/java:1": {
			"version": "none",
			"installMaven": "false",
			"installGradle": "false"
		}
	},
	"postCreateCommand": "curl -fL https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-pc-linux.gz | gzip -d > cs && chmod +x cs && yes | ./cs setup && echo 'before start run source ~/.profile'",

	"customizations": {
		"vscode": {
			"extensions": [
				"scala-lang.scala",
				"streetsidesoftware.code-spell-checker"
			]
		}
	}
}