Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bootstrap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
FROM python:3.11.7-slim-bullseye

# Ensure that the git describe exists and also is in valid format as well
# The format can be invalid if someone is build BlueOS without a tag as reference
ARG GIT_DESCRIBE_TAGS
ENV GIT_DESCRIBE_TAGS=${GIT_DESCRIBE_TAGS:-0.0.0-0-g00000000}
RUN <<-EOF
set -e

if [[ ! $GIT_DESCRIBE_TAGS =~ -[0-9]+-g[a-f0-9]{8}$ ]]; then
echo "Invalid format: $GIT_DESCRIBE_TAGS (E.g: <TAG>-<COMMIT_NUMBER>-g<SHORT_HASH>)"
exit 1
fi

EOF

COPY startup.json.default bootstrap/ /bootstrap/
COPY main.py /
COPY pip.conf /etc/
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docker build . --tag bluerobotics/bootstrap:master
Everytime it is launched, it will load the startup settings, wait until the core container is not running, and re-create and re-launch it.

```bash
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /config:/config bluerobotics/bootstrap:master
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /config:/config bluerobotics/blueos-bootstrap:master
```

This will automatically populate /config if there is no valid config file in there, fetch if necessary, and then launch BlueOS.
9 changes: 5 additions & 4 deletions bootstrap/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
logger.info("Please supply the host path for the config files as the BLUEOS_CONFIG_PATH environment variable.")
logger.info("Example docker command line:")
logger.info(
"docker run -it -v /var/run/docker.sock:/var/run/docker.sock"
" -v $HOME/.config/blueos:"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The volume mapping now explicitly maps $HOME/.config/blueos to /root/.config/blueos.

This mapping only works if the container runs as root. Please document or address cases where a different user is used.

"docker run -it --network=host"
" -v /var/run/docker.sock:/var/run/docker.sock"
" -v $HOME/.config/blueos:/root/.config/blueos"
" -v /var/logs/blueos:/var/logs/blueos"
"/root/.config/blueos -e BLUEOS_CONFIG_PATH=$HOME/.config/blueos"
"bluerobotics/blueos-bootstrap:master"
" /root/.config/blueos -e BLUEOS_CONFIG_PATH=$HOME/.config/blueos"
" bluerobotics/blueos-bootstrap:master"
)
sys.exit(1)

Expand Down
6 changes: 0 additions & 6 deletions core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ ENV GIT_DESCRIBE_TAGS=${GIT_DESCRIBE_TAGS:-0.0.0-0-g00000000}
RUN <<-EOF
set -e

if [ -z "$GIT_DESCRIBE_TAGS" ]; then
echo "GIT_DESCRIBE_TAGS argument not provided."
echo "Use: --build-arg GIT_DESCRIBE_TAGS=\$(git describe --tags --long --always)"
exit 1
fi

if [[ ! $GIT_DESCRIBE_TAGS =~ -[0-9]+-g[a-f0-9]{8}$ ]]; then
echo "Invalid format: $GIT_DESCRIBE_TAGS (E.g: <TAG>-<COMMIT_NUMBER>-g<SHORT_HASH>)"
exit 1
Expand Down