Skip to content

Commit

Permalink
ci: Fix entrypoint execution on devcontainer entry
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-caspers committed Jun 13, 2024
1 parent 20c7383 commit 472aa82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]
2 changes: 2 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"dockerfile": "Dockerfile"
},
"runArgs": ["-v", ".:/workspace"],
"overrideCommand": true,
"postStartCommand": ". /entrypoint.sh",
"customizations": {
"vscode": {
"extensions": [
Expand Down
5 changes: 4 additions & 1 deletion .devcontainer/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

# Run the CMD (either the default from the Dockerfile or the one provided as docker run argument)
exec "$@"

0 comments on commit 472aa82

Please sign in to comment.