-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds instructions to build a docker image in an x86/x64 architecture …
…for arm64/v8 and avoid installing everything in the RPI. Signed-off-by: Agustin Alba Chicar <[email protected]>
- Loading branch information
1 parent
2e552b5
commit bfa1c3d
Showing
2 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM arm64v8/ros:humble as base | ||
|
||
# Arguments for building | ||
ARG USERID | ||
ARG USER | ||
|
||
# Setup environment | ||
ENV TERM linux | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
||
# Copy requirement files and install dependencies | ||
COPY docker/requirements.txt . | ||
RUN apt-get update && apt-get install --no-install-recommends -y $(cat requirements.txt) | ||
RUN rm requirements.txt | ||
|
||
# Create a user with passwordless sudo | ||
RUN adduser --uid $USERID --gecos "ekumen developer" --disabled-password $USER | ||
RUN adduser $USER sudo | ||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
RUN echo "export QT_X11_NO_MITSHM=1" >> /home/$USER/.bashrc | ||
USER $USER | ||
|
||
# Adds USER to dialout and plugdev group. | ||
# This is needed to access the serial ports, for further references check | ||
# the libserial documentation. | ||
RUN sudo usermod -a -G dialout $USER | ||
RUN sudo usermod -a -G plugdev $USER | ||
|
||
# Creates the src folder of the workspace. | ||
RUN mkdir -p /home/$USER/ws/src | ||
|
||
# Adds to bashrc the ros humble overlay sourcing. | ||
RUN echo "source /opt/ros/humble/setup.bash" >> /home/$USER/.bashrc | ||
# Adds colcon autocomplete | ||
RUN echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> /home/$USER/.bashrc | ||
|
||
# Updates and initializes rosdep. | ||
RUN sudo apt upgrade -y && sudo apt update && rosdep update | ||
|
||
# Defines a workspace folder. | ||
WORKDIR /home/$USER/ws | ||
|
||
CMD ["/bin/bash"] | ||
|
||
FROM base AS dev | ||
|
||
# Clone the repository. | ||
RUN git clone https://github.com/Ekumen-OS/andino.git src/ | ||
# Install the workspace dependencies and the repository. | ||
# TODO: fix dependencies so rosdep does not fail. | ||
RUN rosdep install --from-paths src --ignore-src -i -y -r || true | ||
SHELL ["/bin/bash", "-c"] | ||
RUN source /opt/ros/humble/setup.bash && \ | ||
colcon build --event-handlers console_direct+ && \ | ||
colcon test --event-handlers console_direct+ | ||
# Source the andino workspace. | ||
RUN echo "source /ws/install/setup.bash" >> /home/$USER/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters