forked from WPI-AIM/ambf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (46 loc) · 1.48 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Import base ros ${ROS_VERSION} image
ARG ROS_VERSION=noetic
FROM ros:${ROS_VERSION}-ros-base
ENV USERNAME="admin"
RUN useradd -ms /bin/bash ${USERNAME}
RUN usermod -aG sudo ${USERNAME}
ENV HOME="/home/${USERNAME}" \
AMBF_WS="/home/${USERNAME}/ambf"
# Add apt-utils
RUN apt clean && \
rm -rf /var/lib/apt/lists/* && \
apt-get update && \
apt-get install apt-utils -q -y \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get -y -qq install wget gdb
# Install git
RUN apt-get update && \
apt-get -y -qq -o Dpkg::Use-Pty=0 install --no-install-recommends \
--fix-missing apt-utils git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p ${AMBF_WS}
# Clone AMBF into $HOME
COPY . ${AMBF_WS}
WORKDIR ${AMBF_WS}
RUN cd ${AMBF_WS}
# Install apt and pip packages listed in (*-requirements.txt)
WORKDIR ${AMBF_WS}
RUN apt-get update && \
apt-get -y -qq -o Dpkg::Use-Pty=0 install --no-install-recommends \
--fix-missing $(cat install/apt-requirements.txt) && \
cat install/pip-requirements.txt | xargs -n 1 -L 1 pip install -U && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Build AMBF
RUN . /opt/ros/noetic/setup.sh && \
mkdir -p ${AMBF_WS}/build && \
cd ${AMBF_WS}/build && \
cmake ../ && \
make -j$(nproc)
RUN touch ${HOME}/.bashrc && \
echo "source /opt/ros/$ROS_VERSION/setup.bash" >> ${HOME}/.bashrc && \
echo "source $AMBF_WS/build/devel/setup.bash" >> ${HOME}/.bashrc
RUN . ${HOME}/.bashrc
WORKDIR ${AMBF_WS}/training_scripts