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

Commit

Permalink
Simplify Docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass committed Nov 28, 2023
1 parent 5c7d529 commit 4ea60b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 deletions.
26 changes: 10 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
/home/${USERNAME}/.ccache \
/home/${USERNAME}/.config \
/home/${USERNAME}/.ignition \
/home/${USERNAME}/.ros/log && \
/home/${USERNAME}/.colcon \
/home/${USERNAME}/.ros && \
chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/

# Install additional dependencies
Expand All @@ -73,7 +74,6 @@ RUN rm -rf build/serial install/serial
FROM base as user-overlay

ARG USERNAME
USER ${USERNAME}
ARG USER_WS=/home/${USERNAME}/user_overlay_ws
ENV USER_WS=${USER_WS}

Expand All @@ -84,18 +84,19 @@ RUN --mount=type=cache,target=/home/${USERNAME}/.ccache \
. /opt/overlay_ws/install/setup.sh && \
colcon build

# Add the custom entrypoint
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
RUN echo "source /entrypoint.sh && set +e" >> ~/.bashrc
# Set up the user's .bashrc file and shell.
RUN echo "source ${USER_WS}/install/setup.bash && set +e" >> /home/${USERNAME}/.bashrc
CMD ["/usr/bin/bash"]

###################################################################
# Target for the developer build which does not compile any code. #
###################################################################
FROM base as user-overlay-dev

USER root
ARG USERNAME
ARG USER_WS=/home/${USERNAME}/user_overlay_ws
ENV USER_WS=${USER_WS}

# Install any additional packages for development work
# hadolint ignore=DL3008
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Expand All @@ -106,13 +107,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
gdb \
nano

USER ${USERNAME}
ARG USERNAME
ARG USER_WS=/home/${USERNAME}/user_overlay_ws
ENV USER_WS=${USER_WS}

# Add the dev entrypoint
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
RUN echo "source /entrypoint.sh && set +e" >> ~/.bashrc
# Set up the user's .bashrc file and shell.
RUN echo "source /moveit_studio_utils/setup_workspaces.sh && set +e" >> /home/${USERNAME}/.bashrc
CMD ["/usr/bin/bash"]
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- USER_GID=${STUDIO_USER_UID:-1000}
- USERNAME=${USERNAME:-studio-user}
- MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main}
# Set the user workspace folder location.
environment:
- USER_WS=/home/${USERNAME:-studio-user}/user_overlay_ws

Expand Down
19 changes: 0 additions & 19 deletions entrypoint.sh

This file was deleted.

0 comments on commit 4ea60b8

Please sign in to comment.