// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/ubuntu
{
	"name": "Ubuntu",
	"build": {
		"dockerfile": "Dockerfile",
		// Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic
		// Use hirsute or bionic on local arm64/Apple Silicon.
		"args": { "VARIANT": "dapr-containerapps" }
	},

	// Set *default* container specific settings.json values on container create.
	"settings": {},
	"containerEnv": {
		"BIND_LOCALHOST_DOCKER": "true"
	},

	"runArgs": [
		// Enable ptrace-based debugging for go
		"--cap-add=SYS_PTRACE",
		"--security-opt",
		"seccomp=unconfined",
		//"--privileged"
	],

	// Add the IDs of extensions you want installed when the container is created.
	"extensions": [
		"ms-azuretools.vscode-bicep",
		"ms-azuretools.vscode-dapr",
		"ms-azuretools.vscode-docker"
	],
	"mounts": [
		// Mount docker-in-docker library volume
		"type=volume,source=dind-var-lib-docker,target=/var/lib/docker",
		// Bind mount docker socket under an alias to support docker-from-docker
		"type=bind,source=/var/run/docker.sock,target=/var/run/docker-host.sock",
		// Uncomment to clone local .kube/config into devcontainer
		// "type=bind,source=${env:HOME}${env:USERPROFILE}/.kube,target=/home/dapr/.kube-localhost",
		// Uncomment to additionally clone minikube certs into devcontainer for use with .kube/config
		// "type=bind,source=${env:HOME}${env:USERPROFILE}/.minikube,target=/home/dapr/.minikube-localhost"
	],

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Use 'postCreateCommand' to run commands after the container is created.
	// "postStartCommand": "sudo chmod 777 /var/run/docker.sock",

	// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
	"remoteUser": "vscode",
	"features": {
		"azure-cli": "latest"
	}
}