forked from VertexStudio/simbotic-ros
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.cpu
124 lines (98 loc) · 3 KB
/
Dockerfile.cpu
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
ARG UBUNTU_VERSION=18.04
FROM ubuntu:${UBUNTU_VERSION} as base
# Pick up some TF dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
sudo \
libfreetype6-dev \
libhdf5-serial-dev \
# libpng12-dev \
libzmq3-dev \
pkg-config \
software-properties-common \
wget \
git \
rsync \
unzip
ARG USE_PYTHON_3_NOT_2=1
ARG _PY_SUFFIX=${USE_PYTHON_3_NOT_2:+3}
ARG PYTHON=python${_PY_SUFFIX}
ARG PIP=pip${_PY_SUFFIX}
# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
RUN apt-get update && apt-get install -y \
${PYTHON} \
${PYTHON}-pip
RUN ${PIP} --no-cache-dir install --upgrade \
pip \
setuptools
# Some TF tools expect a "python" binary
RUN ln -s $(which ${PYTHON}) /usr/local/bin/python
# Options:
# tensorflow
# tensorflow-gpu
# tf-nightly
# tf-nightly-gpu
ARG TF_PACKAGE=tf-nightly
RUN ${PIP} install ${TF_PACKAGE}
RUN ${PIP} install msgpack-rpc-python
COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=America/Detroit
RUN apt-get update && apt-get install -y tzdata
# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*
# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
python-rosdep \
python-rosinstall \
python-vcstools \
&& rm -rf /var/lib/apt/lists/*
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_LOG_DIR=/home/sim/.ros
# bootstrap rosdep
RUN rosdep init \
&& rosdep update
# install ros packages
ENV ROS_DISTRO melodic
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-ros-core && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-pointcloud-to-laserscan
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-cv-bridge
RUN ${PIP} install rospkg pyyaml osc4py3
RUN apt-get update && apt-get install -y \
python3-jinja2 \
python3-empy \
&& rm -rf /var/lib/apt/lists/*
RUN ${PIP} install numpy toml catkin_pkg \
dronekit dronekit-sitl
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g ${GROUP_ID} sim && \
useradd -m -l -u ${USER_ID} -g sim sim && \
echo "sim:sim" | chpasswd && adduser sim sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV HOME /home/sim
ENV SIM_ROOT=$HOME
USER sim
WORKDIR $HOME
ENTRYPOINT ["./ros_entrypoint.sh"]
CMD ["bash"]