-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
84 lines (70 loc) · 2.7 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
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
# This Dockerfile is used to build an ROS + OpenGL + Gazebo + Tensorflow image based on Ubuntu 18.04
FROM nvidia/cudagl:10.0-devel-ubuntu18.04
LABEL maintainer "Henry Huang"
MAINTAINER Henry Huang "https://github.com/henry2423"
ENV REFRESHED_AT 2019-02-12
# Install sudo
RUN apt-get update && \
apt-get install -y sudo apt-utils curl
# Environment config
ENV DEBIAN_FRONTEND=noninteractive
# Add new sudo user
ARG user=ros
ARG passwd=ros
ARG uid=1000
ARG gid=1000
ENV USER=$user
ENV PASSWD=$passwd
ENV UID=$uid
ENV GID=$gid
RUN useradd --create-home -m $USER && \
echo "$USER:$PASSWD" | chpasswd && \
usermod --shell /bin/bash $USER && \
usermod -aG sudo $USER && \
echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USER && \
chmod 0440 /etc/sudoers.d/$USER && \
# Replace 1000 with your user/group id
usermod --uid $UID $USER && \
groupmod --gid $GID $USER
### ROS and Gazebo Installation
# Install other utilities
RUN apt-get update && \
apt-get install -y vim \
tmux \
git \
wget \
lsb-release \
lsb-core
# Install ROS
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list' && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 && \
apt-get update && apt-get install -y ros-melodic-desktop && \
apt-get install -y python-rosinstall && \
rosdep init
# Install Gazebo
RUN sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' && \
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - && \
apt-get update && \
apt-get install -y gazebo9 libgazebo9-dev && \
apt-get install -y ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control
# Setup ROS
USER $USER
RUN rosdep fix-permissions && rosdep update
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
RUN /bin/bash -c "source ~/.bashrc"
###Tensorflow Installation
# Install pip
USER root
RUN apt-get install -y wget python-pip python-dev libgtk2.0-0 unzip libblas-dev liblapack-dev libhdf5-dev && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py
# prepare default python 2.7 environment
USER root
#pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.11.0-cp27-none-linux_x86_64.whl && \
RUN pip install tensorflow-gpu==1.13.0rc1 keras==2.2.4 matplotlib pandas scipy h5py testresources scikit-learn
# Expose Jupyter
EXPOSE 8888
# Expose Tensorboard
EXPOSE 6006
### Switch to root user to install additional software
USER $USER