Skip to content

Commit

Permalink
Parameterize base image name for the nav2 build (issue #161)
Browse files Browse the repository at this point in the history
  • Loading branch information
eholum committed Sep 24, 2024
1 parent b551008 commit bd6de91
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 6 additions & 3 deletions navigation2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
#
# The script provides the following build arguments:
#
# VCS_REF - The git revision of the Space ROS source code (no default value).
# VERSION - The version of Space ROS (default: "preview")
# VCS_REF - The git revision of the Space ROS source code (no default value).
# VERSION - The version of Space ROS (default: "preview")
# SPACE_ROS_IMAGE - The base Space ROS image to build on

FROM osrf/space-ros:latest
ARG SPACE_ROS_IMAGE=osrf/space-ros:latest

FROM ${SPACE_ROS_IMAGE}

# Define arguments used in the metadata definition
ARG VCS_REF
Expand Down
8 changes: 8 additions & 0 deletions navigation2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ To build the docker image, run:

The build process will take about 30 minutes, depending on the host computer.

By default, this will build on top of the latest released version of the Space ROS base image (typically `osrf/space-ros:latest`).
If building locally, the underlying base image can be set in the [build script](./build.sh), or through the environment with:

```bash
# Use a locally built image as the base
SPACE_ROS_IMAGE="space-ros:main" ./build.sh
```

## Running the Navigation2 Docker Image in a Container

After building the image, you can see the newly-built image by running:
Expand Down
4 changes: 3 additions & 1 deletion navigation2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ echo ""

docker build -t $ORG/$IMAGE:$TAG \
--build-arg VCS_REF="$VCS_REF" \
--build-arg VERSION="$VERSION" .
--build-arg VERSION="$VERSION" \
--build-arg SPACE_ROS_IMAGE="${SPACE_ROS_IMAGE:-osrf/space-ros:latest}" \
.

echo ""
echo "##### Done! #####"
Expand Down

0 comments on commit bd6de91

Please sign in to comment.