Skip to content

Commit

Permalink
Change default args for whole Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Aug 14, 2024
1 parent 141b9a6 commit 51944b7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/api-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
ARG BRANCH=main
ARG ROS_DISTRO=jazzy
ARG BASE_IMAGE

FROM $BASE_IMAGE as base

ARG BRANCH="main"
ARG ROS_DISTRO="jazzy"
ARG BRANCH

# fetch sources
RUN mkdir -p /ws \
Expand All @@ -22,17 +24,17 @@ RUN rm -rf \
# ENTRYPOINT ["bash", "-c", ". /opt/rmf/setup.bash && pnpm start"]

### Set up minimal image

FROM docker.io/library/ros:$ROS_DISTRO-ros-core

ARG ROS_DISTRO

RUN apt update && apt install -y ros-$ROS_DISTRO-rmw-cyclonedds-cpp

# according to rosdep, the messages have no deps so we can just copy the files directly in!
# this reduces the image size by ~50%.
COPY --from=base /opt/rmf/include /opt/ros/$ROS_DISTRO/include
COPY --from=base /opt/rmf/install/lib /opt/ros/$ROS_DISTRO/lib
COPY --from=base /opt/rmf/install/local /opt/ros/$ROS_DISTRO/local
COPY --from=base /opt/rmf/install/share /opt/ros/$ROS_DISTRO/share
COPY --from=base /opt/rmf/lib /opt/ros/$ROS_DISTRO/lib
COPY --from=base /opt/rmf/share /opt/ros/$ROS_DISTRO/share

# Copy over ws alongside the python virtual environment
RUN mkdir /ws
Expand All @@ -47,4 +49,4 @@ RUN rm -rf \

ENV RMF_API_SERVER_CONFIG /ws/packages/api-server/sqlite_local_config.py
WORKDIR /ws/packages/api-server
ENTRYPOINT ["bash", "-c", ". /opt/rmf/setup.bash && mkdir -p run/cache && ../../.venv/bin/pipenv run python -m api_server"]
ENTRYPOINT ["bash", "-c", ". /opt/ros/setup.bash && mkdir -p run/cache && ../../.venv/bin/pipenv run python -m api_server"]

0 comments on commit 51944b7

Please sign in to comment.