To ensure it is unique on the main host (i.e., outside the container). Get rid of devcontainer_initialize.sh, all it did was run "mkdir". Something this trivial can be inlined in the devcontainer.json (less indirection this way).
34 lines
1.1 KiB
JSON
34 lines
1.1 KiB
JSON
{
|
|
"image": "bluetradingsystems/sparkd-dev:latest",
|
|
// Creates local dir to mount to HOME in docker
|
|
"initializeCommand": "mkdir -p ${localEnv:HOME}/.bts/devcontainer-mounts/${devcontainerId}",
|
|
"hostRequirements": {
|
|
"memory": "4gb",
|
|
"storage": "6gb"
|
|
},
|
|
"postCreateCommand": "/home/bts/spark/docker/sparkd/dev/devcontainer_post_create.sh",
|
|
"containerUser": "bts",
|
|
"workspaceMount": "source=${localWorkspaceFolder},target=/home/bts/spark,type=bind",
|
|
"workspaceFolder": "/home/bts/spark",
|
|
"updateRemoteUserUID": true,
|
|
"shutdownAction": "none",
|
|
// Note: If running multiple containers on the same host, each must use a
|
|
// unique set of ports. Usually we just add 1000 to each port as needed. For
|
|
// example, if 8000-8003 is taken, go with 9000-9003, then 10000-10003, etc.
|
|
"runArgs": [
|
|
"--shm-size",
|
|
"2gb",
|
|
"-p",
|
|
"8000:8000",
|
|
"-p",
|
|
"8001:8001",
|
|
"-p",
|
|
"8002:8002",
|
|
"-p",
|
|
"8003:8003"
|
|
],
|
|
"mounts": [
|
|
"source=${localEnv:HOME}/.bts/devcontainer-mounts/${devcontainerId},target=/home/bts,type=bind"
|
|
]
|
|
}
|