Skip to content

Commit

Permalink
fix: configure git within container to work by default
Browse files Browse the repository at this point in the history
  • Loading branch information
akevinge committed Sep 12, 2024
1 parent a7f5571 commit cd94153
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
// "shutdownAction": "none",
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// Flag the /bootloader directory as safe (so git works by default)
// and allow git to open editing in VSCode (e.g. for interactive rebase).
"postAttachCommand": "git config --global --add safe.directory /navigator && /opt/entrypoint.sh",
"postAttachCommand": "/opt/entrypoint.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ services:
- type: bind
source: /dev
target: /dev
# Set local ~/.gitconfig to system git config within container.
# If you don't have a ~/.gitconfig, please create one.
- $HOME/.gitconfig:/etc/gitconfig

#- type: bind
# source: /dev/shm
# target: /dev/shm
Expand Down
7 changes: 5 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ source /navigator/install/setup.bash
# export PYTHONPATH="${CARLA_ROOT}/PythonAPI/carla/":"${SCENARIO_RUNNER_ROOT}":"${LEADERBOARD_ROOT}":"${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.13-py3.7-linux-x86_64.egg":${PYTHONPATH}
# source /workspace/install/setup.bash

echo "🔧 Setting up aliases..."
echo "🔧 Setting up aliases and git settings..."
echo "alias navigator=\"python3 /navigator/navigator.py\"" >> ~/.bashrc

git config --global --add safe.directory /navigator


echo "👍 Finished environment setup"

if [ -z ${@+x} ]; then
exec bash
else
exec bash -c "$@"
fi
fi

0 comments on commit cd94153

Please sign in to comment.