chore: fix devcontainer on codespaces (#23412)

This commit is contained in:
Felipe Santos 2023-07-17 16:38:12 -03:00 committed by GitHub
parent ab7f679364
commit 4c43c0dc78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 12 deletions

View file

@ -1,15 +1,18 @@
{ {
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json", "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
"hostRequirements": {
"cpus": 4,
"memory": "7gb",
"storage": "32gb"
},
"name": "Renovate", "name": "Renovate",
"dockerFile": "Dockerfile", "dockerFile": "Dockerfile",
"features": { "features": {
"ghcr.io/devcontainers/features/common-utils:2": {} "ghcr.io/devcontainers/features/common-utils:2": {}
}, },
"capAdd": ["SYS_PTRACE"],
"privileged": true,
"securityOpt": ["seccomp=unconfined"],
"hostRequirements": {
"cpus": 4,
"memory": "7gb",
"storage": "32gb"
},
"customizations": { "customizations": {
"vscode": { "vscode": {
"extensions": [ "extensions": [
@ -21,13 +24,7 @@
] ]
} }
}, },
"runArgs": [ "postCreateCommand": [".devcontainer/post-create.sh"],
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--privileged"
],
"postCreateCommand": "yarn install",
// Otherwise jest watcher fails because deps were not installed yet // Otherwise jest watcher fails because deps were not installed yet
"waitFor": "postCreateCommand" "waitFor": "postCreateCommand"
} }

12
.devcontainer/post-create.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
set -e
if [[ "${CODESPACES}" == true ]]; then
echo "Fixing permissions of /tmp for GitHub Codespaces..." >&2
sudo chmod 1777 /tmp
fi
set -x
exec yarn install