Skip to content

Commit

Permalink
Parameterize base image name for the MoveIt2 build (issue #161)
Browse files Browse the repository at this point in the history
  • Loading branch information
eholum committed Sep 24, 2024
1 parent abf83e4 commit b551008
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,27 @@ 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
uses: actions/checkout@v4
- name: Set up buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Build moveit2 image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: moveit2
push: false
tags: openrobotics/moveit2:latest
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 All @@ -43,11 +51,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Build space_nav2 image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: navigation2
push: false
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 b551008

Please sign in to comment.