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 19, 2024
1 parent abf83e4 commit fc0482c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 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
4 changes: 3 additions & 1 deletion moveit2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
# VCS_REF - The git revision of the Space ROS source code (no default value).
# VERSION - The version of Space ROS (default: "preview")

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 fc0482c

Please sign in to comment.