-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
68 lines (57 loc) · 2.65 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
#
# ROS Melodic with build tools Dockerfile
#
# https://github.com/shadow-robot/sr-build-tools/
#
FROM ros:melodic-perception
MAINTAINER "Shadow Robot's Software Team <[email protected]>"
LABEL Description="This image is used to make ROS Melodic based projects build faster using build tools" Vendor="Shadow Robot" Version="1.0"
ENV DEBIAN_FRONTEND noninteractive
ENV PULSE_SERVER /run/pulse/native
ENV GOSU_VERSION 1.10
ENV MY_USERNAME user
ARG toolset_branch
ENV toolset_branch ${toolset_branch:-"legacy"}
ENV server_type="docker_hub"
ENV used_modules="check_cache,create_workspace"
ENV ros_release_name=melodic
ENV remote_shell_script="https://raw.githubusercontent.com/shadow-robot/sr-build-tools/$toolset_branch/bin/sr-run-ci-build.sh"
ENV remote_additional_bashrc_cmds="https://raw.githubusercontent.com/shadow-robot/sr-build-tools/$toolset_branch/docker/utils/additional_bashrc_cmds_melodic"
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY terminator_config /tmp/terminator_config
RUN set -x && \
\
echo "Installing wget" && \
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends ca-certificates wget sudo curl && \
apt-get install -y bash-completion && \
apt-get install -y gdb && \
\
echo "Running one-liner" && \
wget -O /tmp/oneliner "$( echo "$remote_shell_script" | sed 's/#/%23/g' )" && \
chmod 755 /tmp/oneliner && \
/tmp/oneliner "$toolset_branch" $server_type 'setup_docker_user' && \
gosu $MY_USERNAME /tmp/oneliner "$toolset_branch" $server_type $used_modules && \
\
echo "Updating bash commands" && \
wget -O /tmp/additional_bashrc_cmds "$( echo "$remote_additional_bashrc_cmds" | sed 's/#/%23/g' )" && \
cat /tmp/additional_bashrc_cmds >> /home/user/.bashrc && \
\
echo "Setting default terminator config" && \
mkdir -p /home/$MY_USERNAME/.config/terminator/ && \
mv /tmp/terminator_config /home/$MY_USERNAME/.config/terminator/config && \
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config &&\
\
echo "Creating XDG_RUNTIME_DIR to avoid rqt black windows" && \
mkdir -p /run/$MY_USERNAME/1000 && \
chmod 0700 /run/$MY_USERNAME/1000 && \
chown 1000:1000 /run/$MY_USERNAME/1000 && \
export XDG_RUNTIME_DIR=/run/$MY_USERNAME/1000 && \
\
echo "Removing cache" && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /home/$MY_USERNAME/.ansible /home/$MY_USERNAME/.gitconfig /home/$MY_USERNAME/.cache
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/usr/bin/terminator"]