mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-22 08:43:58 +08:00
Devcontainer: use "batman" user instead of root (#29704)
* devcontainer user * cleanup permissions * remove that * remove that since it's not used * clean that up after merge * build base image first * remove the pull * build base image * ensure we can pip install * build base image as batman user * add user uid * add temporary comment about chown instruction
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
FROM ghcr.io/commaai/openpilot-base:latest
|
||||
|
||||
# remove gitconfig if exists, since its gonna be replaced by host one
|
||||
RUN rm -f /root/.gitconfig
|
||||
|
||||
RUN apt update && apt install -y vim net-tools usbutils htop ripgrep tmux
|
||||
RUN pip install ipython jupyter jupyterlab
|
||||
|
||||
|
||||
@@ -12,3 +12,9 @@ if [ -n "\$DISPLAY" ]; then
|
||||
fi
|
||||
EOF
|
||||
fi
|
||||
|
||||
# These lines are temporary, to remain backwards compatible with old devcontainers
|
||||
# that were running as root and therefore had their caches written as root
|
||||
USER=batman
|
||||
sudo chown -R $USER: /tmp/scons_cache
|
||||
sudo chown -R $USER: /tmp/comma_download_cache
|
||||
@@ -14,13 +14,23 @@
|
||||
},
|
||||
"runArgs": [
|
||||
"--volume=/tmp/.X11-unix:/tmp/.X11-unix",
|
||||
"--volume=${localWorkspaceFolder}/.devcontainer/.host/.Xauthority:/root/.Xauthority",
|
||||
"--volume=${localEnv:HOME}/.comma:/root/.comma",
|
||||
"--volume=${localWorkspaceFolder}/.devcontainer/.host/.Xauthority:/home/batman/.Xauthority",
|
||||
"--volume=${localEnv:HOME}/.comma:/home/batman/.comma",
|
||||
"--volume=/tmp/comma_download_cache:/tmp/comma_download_cache",
|
||||
"--volume=/tmp/devcontainer_scons_cache:/tmp/scons_cache",
|
||||
"--shm-size=1G",
|
||||
"--add-host=host.docker.internal:host-gateway" // required to use host.docker.internal on linux
|
||||
],
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/common-utils:2": {
|
||||
"installZsh": false,
|
||||
"installOhMyZsh": false,
|
||||
"upgradePackages": false,
|
||||
"username": "batman"
|
||||
}
|
||||
},
|
||||
"containerUser": "root",
|
||||
"remoteUser": "batman",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
|
||||
Reference in New Issue
Block a user