diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4bcf6f5..e344725 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -42,3 +42,4 @@ COPY entrypoint.sh / RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] +CMD ["/bin/bash"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 531d797..087ac67 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,6 +5,8 @@ "dockerfile": "Dockerfile" }, "runArgs": ["-v", ".:/workspace"], + "overrideCommand": true, + "postStartCommand": ". /entrypoint.sh", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/entrypoint.sh b/.devcontainer/entrypoint.sh index 4664f3f..09f362f 100644 --- a/.devcontainer/entrypoint.sh +++ b/.devcontainer/entrypoint.sh @@ -1,6 +1,9 @@ #!/bin/bash # Build the package mounted in the container +echo "Building workspace with colcon" . /opt/ros/humble/setup.sh && . /ros_deps/install/setup.sh && colcon build echo "source /workspace/install/setup.sh" >> /root/.bashrc -/bin/bash \ No newline at end of file + +# Run the CMD (either the default from the Dockerfile or the one provided as docker run argument) +exec "$@"