Skip to content

Commit

Permalink
feat: Fix file copy ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
j3soon committed Nov 1, 2024
1 parent 1876e05 commit ced462f
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 32 deletions.
10 changes: 6 additions & 4 deletions aloha_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand All @@ -138,7 +138,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
# Install Aloha Interbotix dependencies
# Ref: https://docs.trossenrobotics.com/interbotix_xsarms_docs/ros_interface/ros2/software_setup.html#amd64-architecture
# Ref: https://github.com/Interbotix/interbotix_ros_manipulators/blob/humble/interbotix_ros_xsarms/install/amd64/xsarm_amd64_install.sh
# Install ros packages based on Interbotix rosdeps
# Install ros packages based on Interbotix rosdeps to speed up build
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
sudo apt-get update && sudo apt-get install -y \
ros-$ROS_DISTRO-moveit-msgs \
Expand All @@ -165,14 +165,16 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
ros-$ROS_DISTRO-joint-state-publisher-gui \
ros-$ROS_DISTRO-topic-based-ros2-control \
&& sudo rm -rf /var/lib/apt/lists/*
COPY script/xsarm_amd64_install.sh /home/user
COPY --chown=$USERNAME:$USERNAME \
script/xsarm_amd64_install.sh /home/$USERNAME
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
bash -ie ~/xsarm_amd64_install.sh -d humble -n \
&& sudo rm -rf /var/lib/apt/lists/* \
&& rm -rf $HOME/.ros/rosdep/sources.cache
COPY udev_rules/99-interbotix-udev.rules /etc/udev/rules.d/

COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions cartographer_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand All @@ -137,7 +137,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
ros-$ROS_DISTRO-rqt-robot-steering \
&& sudo rm -rf /var/lib/apt/lists/*

COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions gazebo_world_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand All @@ -130,7 +130,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
&& sudo rm -rf /var/lib/apt/lists/*

# TODO: Add more commands here
COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]
14 changes: 9 additions & 5 deletions husky_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand Down Expand Up @@ -157,25 +157,29 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
ros-$ROS_DISTRO-imu-tools \
ros-$ROS_DISTRO-teleop-twist-keyboard \
&& sudo rm -rf /var/lib/apt/lists/*
COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here

# Setup husky controller by the script.
# Build certain packages from source for arm64.
COPY script /home/$USERNAME/script
COPY --chown=$USERNAME:$USERNAME \
script /home/$USERNAME/script
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
sudo apt-get update \
&& bash -ie /home/$USERNAME/script/install-clearpath-robot.sh \
&& sudo rm -rf /var/lib/apt/lists/*
# Note: The script need to be run as user, not root.
# Reference: https://github.com/clearpathrobotics/clearpath_computer_installer/tree/main
COPY clearpath_computer_installer /home/$USERNAME/clearpath_computer_installer
COPY --chown=$USERNAME:$USERNAME \
clearpath_computer_installer /home/$USERNAME/clearpath_computer_installer
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
sudo apt-get update \
&& bash -ie /home/$USERNAME/clearpath_computer_installer/clearpath_computer_installer.sh \
&& sudo rm -rf /var/lib/apt/lists/*
# Setup udev rules.
COPY udev_rules /home/$USERNAME/udev_rules
COPY --chown=$USERNAME:$USERNAME \
udev_rules /home/$USERNAME/udev_rules
RUN /home/$USERNAME/udev_rules/install_udev_rules.sh
# Generate robot configuration files.
RUN bash -ie /home/$USERNAME/script/husky-generate.sh
Expand Down
11 changes: 7 additions & 4 deletions kobuki_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand Down Expand Up @@ -166,15 +166,18 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
ros-$ROS_DISTRO-slam-toolbox \
ros-$ROS_DISTRO-robot-localization \
&& sudo rm -rf /var/lib/apt/lists/*
COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here

# Setup udev rules for Kobuki.
COPY udev_rules /home/$USERNAME/udev_rules
COPY --chown=$USERNAME:$USERNAME \
udev_rules /home/$USERNAME/udev_rules
RUN /home/$USERNAME/udev_rules/install_udev_rules.sh

# Build the kobuki driver workspace
COPY --chown=$USER_UID kobuki_driver_ws /home/$USERNAME/kobuki_driver_ws
COPY --chown=$USERNAME:$USERNAME \
kobuki_driver_ws /home/$USERNAME/kobuki_driver_ws
RUN cd /home/$USERNAME/kobuki_driver_ws \
&& rm -rf COLCON_IGNORE \
&& /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash; colcon build --symlink-install"
Expand Down
5 changes: 3 additions & 2 deletions orbslam3_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand Down Expand Up @@ -194,7 +194,8 @@ RUN rosdep update && \
. /opt/ros/humble/setup.sh && \
colcon build --symlink-install --packages-select orbslam3

COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]
12 changes: 7 additions & 5 deletions ros1_bridge_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
################################################################################################
# - Build stage
# - In this stage, I will build ROS Humble and ros1-bridge from source.
# - Reference:
# - Reference:
# - https://docs.ros.org/en/humble/How-To-Guides/Using-ros1_bridge-Jammy-upstream.html
# - https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html
################################################################################################
Expand Down Expand Up @@ -126,7 +126,7 @@ RUN colcon build
# Delete packages.ros.org from sources.list and remove conflicts packages manually.
# Removing those conflicts packages is necessary for install ros-core-dev.
# Here is the dicussion about this issue: https://github.com/j3soon/ros2-essentials/pull/9#discussion_r1375303858
# Reference:
# Reference:
# - https://docs.ros.org/en/humble/How-To-Guides/Using-ros1_bridge-Jammy-upstream.html#ros-2-via-debian-packages
# - https://github.com/osrf/docker_images/issues/635#issuecomment-1217505552
RUN rm -rf /etc/apt/sources.list.d/ros2.list \
Expand All @@ -149,7 +149,8 @@ RUN source install/setup.bash \

# Other configurations
USER $USERNAME
COPY ./start-bridge.sh /start-bridge.sh
COPY --chown=$USERNAME:$USERNAME \
./start-bridge.sh /start-bridge.sh
ENTRYPOINT []
CMD ["/bin/bash"]

Expand All @@ -169,7 +170,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
tzdata \
&& rm -rf /var/lib/apt/lists/*

# Install ROS core and packages with their dependencies.
# Install ROS core and packages with their dependencies.
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
apt-get update && apt-get install -y \
ros-core-dev \
Expand All @@ -182,6 +183,7 @@ COPY --from=build /ros2_humble/install /ros2_humble/install

# Other configurations
USER $USERNAME
COPY ./start-bridge.sh /start-bridge.sh
COPY --chown=$USERNAME:$USERNAME \
./start-bridge.sh /start-bridge.sh
ENTRYPOINT []
CMD ["./start-bridge.sh"]
5 changes: 3 additions & 2 deletions rtabmap_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand All @@ -142,7 +142,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
ros-$ROS_DISTRO-rtabmap-ros \
&& sudo rm -rf /var/lib/apt/lists/*

COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions template_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand All @@ -128,7 +128,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
&& sudo rm -rf /var/lib/apt/lists/*

# TODO: Add more commands here
COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions tests/diff_base/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand All @@ -129,7 +129,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \

# TODO: Add more commands here
{PLACEHOLDER_MULTILINE}
COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
{PLACEHOLDER_MULTILINE}
ENTRYPOINT []
Expand Down
5 changes: 3 additions & 2 deletions vlp_ws/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN mkdir /home/$USERNAME/.gazebo
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
# TODO: Remove the note above when it is no longer experimental
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
RUN --mount=type=cache,target=/home/$USERNAME/.cache/pip,sharing=private \
if [ "$TARGETARCH" = "amd64" ]; then \
python3 -V | grep "Python 3.10" \
&& pip install isaacsim==4.2.0.2 --extra-index-url https://pypi.nvidia.com \
Expand Down Expand Up @@ -149,7 +149,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
ros-$ROS_DISTRO-velodyne \
&& sudo rm -rf /var/lib/apt/lists/*

COPY .bashrc /home/$USERNAME/.bashrc
COPY --chown=$USERNAME:$USERNAME \
.bashrc /home/$USERNAME/.bashrc
# TODO: Copy additional files here
ENTRYPOINT []
CMD ["/bin/bash"]

0 comments on commit ced462f

Please sign in to comment.