Skip to content

Commit

Permalink
Parameterize base image name for the MoveIt2 build (issue space-ros#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
eholum committed Oct 1, 2024
1 parent 971876b commit 23adec1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
# free up a lot of stuff from /usr/local
sudo rm -rf /usr/local
df -h
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up buildx
Expand All @@ -33,6 +39,8 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
no-cache: false
build-args: |
SPACE_ROS_IMAGE=ghcr.io/space-ros/space-ros:main
outputs: type=docker,dest=/tmp/moveit2.tar
- name: Build space robots demo image
run: |
Expand Down
9 changes: 6 additions & 3 deletions moveit2/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 moveit2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ To build the docker image, run:
./build.sh
```

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
```

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

## Running the MoveIt2 Docker Image in a Container
Expand Down
4 changes: 3 additions & 1 deletion moveit2/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 23adec1

Please sign in to comment.