Skip to content

Instantly share code, notes, and snippets.

@atinfinity
Last active August 3, 2023 02:24
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atinfinity/d8d1f18b2dd6be5c4c45edc59544a395 to your computer and use it in GitHub Desktop.
Save atinfinity/d8d1f18b2dd6be5c4c45edc59544a395 to your computer and use it in GitHub Desktop.
Autoware Auto(w/o ADE) on Docker
FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu20.04
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
# add new sudo user
ENV USERNAME autoware
ENV HOME /home/$USERNAME
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \
usermod --shell /bin/bash $USERNAME && \
usermod -aG sudo $USERNAME && \
mkdir /etc/sudoers.d && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
# Replace 1000 with your user/group id
usermod --uid 1000 $USERNAME && \
groupmod --gid 1000 $USERNAME
# install package
RUN echo "Acquire::GzipIndexes \"false\"; Acquire::CompressionTypes::Order:: \"gz\";" > /etc/apt/apt.conf.d/docker-gzip-indexes
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
sudo \
less \
emacs \
apt-utils \
tzdata \
git \
tmux \
bash-completion \
command-not-found \
software-properties-common \
curl \
gnupg2 \
lsb-release \
keyboard-configuration \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install Git LFS
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install git-lfs && \
git lfs install && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install ROS2 foxy
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-foxy-ros-base \
ros-foxy-rmw-cyclonedds-cpp \
python3-argcomplete \
python3-colcon-common-extensions \
python3-pip \
python3-vcstool \
python3-rosdep \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN rosdep init
USER $USERNAME
WORKDIR /home/$USERNAME
RUN rosdep update
SHELL ["/bin/bash", "-c"]
# install Autoware Auto
RUN source /opt/ros/foxy/setup.bash && \
git lfs clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git -b 1.0.0 && \
cd AutowareAuto && \
sed -i -e 's/ fetchexclude = \*.pcd//' .lfsconfig && \
git lfs pull && \
sudo apt-get update && \
vcs import < autoware.auto.$ROS_DISTRO.repos && \
rosdep install -y -i --from-paths src && \
sudo mkdir /opt/AutowareAuto && \
sudo chmod 777 /opt/AutowareAuto && \
colcon build --install-base /opt/AutowareAuto --cmake-args -DCMAKE_BUILD_TYPE=Release && \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/*
RUN echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc && \
echo "source /opt/AutowareAuto/setup.bash" >> ~/.bashrc && \
echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> ~/.bashrc && \
echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc && \
source ~/.bashrc
#!/bin/sh
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run --runtime=nvidia --privileged --rm -it \
--volume=$XSOCK:$XSOCK:rw \
--volume=$XAUTH:$XAUTH:rw \
--volume=$HOME:$HOME \
--shm-size=1gb \
--env="XAUTHORITY=${XAUTH}" \
--env="DISPLAY=${DISPLAY}" \
--env=TERM=xterm-256color \
--env=QT_X11_NO_MITSHM=1 \
--net=host \
autoware.auto:1.0.0 \
bash
@atinfinity
Copy link
Author

atinfinity commented Jun 20, 2022

@NovoG93 Sorry. I tried to run docker build. As a result, this problem(GPG error) has been reproduced. It seems that NVIDIA's comment was incorrect in forum.

/home/autoware/AutowareAuto/src/drivers/xsens_nodes/include/xsens_nodes/xsens_imu_node.hpp:28:10: fatal error: serial_driver/serial_driver_node.hpp: No such file or directory

This post may be helpful.
https://answers.ros.org/question/389543/autowareauto-100-build-failed-with-xsens_nodes-and-euclidean_cluster/

And, I found that the documentation of Autoware is updated.


This Dockerfile is throwaway code for my study of Autoware.
So, I have no plans to maintain.

@NovoG93
Copy link

NovoG93 commented Jun 20, 2022

Will look into the links and when I find a solution post it here.

This Dockerfile is throwaway code for my study of Autoware.
So, I have no plans to maintain.

Thank you for your help, appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment