Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Add overlay Docker image option #1

Merged
merged 2 commits into from
Mar 24, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Erik PR comments
sea-bass committed Mar 24, 2023
commit 3280636c2b1ebf5623efe404f997d520aa5e49bd
10 changes: 7 additions & 3 deletions .docker/entrypoint-dev.sh
Original file line number Diff line number Diff line change
@@ -8,13 +8,17 @@ set -e
shopt -s expand_aliases
source "/common_aliases.sh"

if [[ -f ${CUSTOM_WS}/install/setup.bash ]]
# If the custom workspace has been compiled we will source the setup.bash file.
# Otherwise it is up to the developer to compile and source it in their session.
if [[ -f ${MOVEIT_STUDIO_CUSTOM_WS}/install/setup.bash ]]
then
echo "Sourcing custom workspace"
source "${CUSTOM_WS}/install/setup.bash"
/copy_dds_configs.sh
source "${MOVEIT_STUDIO_CUSTOM_WS}/install/setup.bash"
else
echo -e "Custom workspace is not built. Please build it with: \ncolcon build\n"
fi

# Copies a DDS configuration file from the user's environment, if available.
/copy_dds_configs.sh

exec "$@"
3 changes: 2 additions & 1 deletion .docker/entrypoint-release.sh
Original file line number Diff line number Diff line change
@@ -4,8 +4,9 @@

set -e

source "${CUSTOM_WS}/install/setup.bash"
source "${MOVEIT_STUDIO_CUSTOM_WS}/install/setup.bash"

# Copies a DDS configuration file from the user's environment, if available.
/copy_dds_configs.sh
sea-bass marked this conversation as resolved.
Show resolved Hide resolved

exec "$@"
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -18,13 +18,13 @@ ARG MOVEIT_STUDIO_BASE_IMAGE
FROM ${MOVEIT_STUDIO_BASE_IMAGE} as base

# The location of the user's custom workspace inside the container
ARG CUSTOM_WS=/opt/custom_ws
ENV CUSTOM_WS $CUSTOM_WS
ARG MOVEIT_STUDIO_CUSTOM_WS=/opt/custom_ws
ENV MOVEIT_STUDIO_CUSTOM_WS $MOVEIT_STUDIO_CUSTOM_WS

# Copy site configuration packages and and dependencies
RUN mkdir -p ${CUSTOM_WS}/src
COPY ./src $CUSTOM_WS/src
WORKDIR $CUSTOM_WS
RUN mkdir -p ${MOVEIT_STUDIO_CUSTOM_WS}/src
COPY ./src $MOVEIT_STUDIO_CUSTOM_WS/src
WORKDIR $MOVEIT_STUDIO_CUSTOM_WS

# Install additional ROS dependencies
# NOTE: The "OVERLAY_WS" contains MoveIt Studio binary packages and the source file.
@@ -40,9 +40,9 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
#################################################
# Target for compiled, deployable release image #
#################################################
FROM base as release
FROM base as moveit-studio-custom-release

WORKDIR $CUSTOM_WS
WORKDIR $MOVEIT_STUDIO_CUSTOM_WS

# Compile the workspace
# hadolint ignore=SC1091
@@ -60,12 +60,12 @@ CMD ["/usr/bin/bash"]
###################################################################
# Expected to mount workspace and compile/test it
# inside of the resulting container.
FROM base as dev
FROM base as moveit-studio-custom-dev

# The location of the user's workspace inside the container
ARG CUSTOM_WS=/opt/custom_ws
ENV CUSTOM_WS $CUSTOM_WS
WORKDIR $CUSTOM_WS
ARG MOVEIT_STUDIO_CUSTOM_WS=/opt/custom_ws
ENV MOVEIT_STUDIO_CUSTOM_WS $MOVEIT_STUDIO_CUSTOM_WS
WORKDIR $MOVEIT_STUDIO_CUSTOM_WS

# Install any additional packages for development work
# hadolint ignore=DL3008
4 changes: 2 additions & 2 deletions docker-compose-overlay.yaml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ services:
# Optionally allow building this service from source with `docker compose build`
build:
context: .
target: release
target: moveit-studio-custom-release
args:
MOVEIT_STUDIO_BASE_IMAGE: ghcr.io/picknikrobotics/moveit-studio:${STUDIO_DOCKER_TAG:-main}
command: sleep infinity
@@ -45,7 +45,7 @@ services:
dev:
extends: base
build:
target: dev
target: moveit-studio-custom-dev
# This image deliberately has no user prefix because it should not be pushed!
stdin_open: true
tty: true