-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
201 lines (167 loc) · 7.13 KB
/
Dockerfile
File metadata and controls
201 lines (167 loc) · 7.13 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
FROM ubuntu:19.04
EXPOSE 22 7200 7777 8080 9090 3000
# Env config
ENV TERM=xterm-256color
# Build args
ARG DEBIAN_FRONTEND=noninteractive
RUN chown root:root /tmp && chmod ugo+rwXt /tmp
RUN apt-get clean && \
apt-get update && \
apt-get install -y \
apt-transport-https \
apt-utils \
ca-certificates \
gnupg
#=============================================
# Do not exclude man pages & other docs.
# Base image is minimized for server usage.
#=============================================
RUN rm /etc/dpkg/dpkg.cfg.d/excludes && \
apt-get update && \
dpkg -l | grep ^ii | cut -d' ' -f3 | xargs apt-get install -y --reinstall && \
rm -f /etc/update-motd.d/60-unminimize /etc/update-motd.d/10-help-text && \
yes | unminimize
#=============================================
# Misc libs and tools
#=============================================
RUN apt-get install -y libgtk2.0-0 libcanberra-gtk-module libxext-dev libxrender-dev libxtst-dev xclip man nano vim software-properties-common \
tmux htop dos2unix mc gnome-keyring figlet jq strace atop rpm python3-pip python-pip graphviz inotify-tools pv xmlstarlet xmldiff \
q-text-as-data m4 tree silversearcher-ag libxml2-utils libwebsockets-dev konsole most tig && \
apt-get clean
#=============================================
# Networking tools
#=============================================
RUN apt-get install -qqy curl telnet tcpdump nmap iputils-ping traceroute whois net-tools dnsutils netcat lsof ngrep sshfs cifs-utils && \
apt-get clean
#=============================================
# GIT
#=============================================
RUN apt-get -y install git bash-completion git-flow gitk tig && \
apt-get clean
#=============================================
# Install java12
#=============================================
RUN apt-get install -y openjdk-11-jdk && \
apt-get clean
#RUN apt-get install -y openjdk-12-jdk && \
# apt-get clean
#=============================================
# Install go
#=============================================
RUN add-apt-repository ppa:longsleep/golang-backports && \
apt-get update && \
apt-get install -y golang-1.13 && \
ln -s /usr/lib/go-1.13/bin/go /usr/bin/go && \
go get github.com/erning/gorun && \
mv ~/go/bin/gorun /usr/bin/gorun
#=============================================
# Install nodejs
#=============================================
RUN apt-get install -y nodejs npm && \
apt-get clean
#=============================================
# Add sudo
#=============================================
RUN apt-get install -y cifs-utils sudo && \
sed -i 's/sudo.*ALL=(ALL:ALL) ALL/sudo ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers
#=============================================
# SSHD
#=============================================
RUN apt-get install -y openssh-server && \
sed -i -e s/prohibit-password/yes/ /etc/ssh/sshd_config
#=============================================
# Firefox
#=============================================
ARG FIREFOX_VERSION=70.0.1
RUN apt-get -y install bzip2 dbus-x11 && \
apt-get -qqy --no-install-recommends install firefox && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 && \
apt-get -y purge firefox && \
rm -rf /opt/firefox && \
tar -C /opt -xjf /tmp/firefox.tar.bz2 && \
rm /tmp/firefox.tar.bz2 && \
mv /opt/firefox /opt/firefox-$FIREFOX_VERSION && \
ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox && \
apt-get clean
#=============================================
# Docker-ce, allow running docker in docker
#=============================================
RUN apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable" && \
apt-get update && \
apt-get install -y docker-ce && \
apt-get clean
#=============================================
# Timezone and locale
#=============================================
ENV TZ=Europe/Oslo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get install -y locales tzdata && \
locale-gen nb_NO.UTF-8 && \
dpkg-reconfigure -f noninteractive tzdata
RUN wget -nv https://packagecloud.io/AtomEditor/atom/gpgkey -O /tmp/AtomEditor_atom.pub.gpg \
&& wget -nv https://dl-ssl.google.com/linux/linux_signing_key.pub -O /tmp/google.pub.gpg \
&& wget -nv https://download.docker.com/linux/ubuntu/gpg -O /tmp/docker.pub.gpg \
&& apt-key add /tmp/google.pub.gpg \
&& apt-key add /tmp/docker.pub.gpg \
&& apt-get clean \
&& apt-get update \
&& apt-get clean \
&& rm /tmp/*.pub.gpg
#=============================================
# Update CA certificates
#=============================================
RUN update-ca-certificates
#=============================================
# Setup key chain for Git credentials
#=============================================
RUN apt-get install -y build-essential libglib2.0-dev libsecret-1-0 libsecret-1-dev && \
cd /usr/share/doc/git/contrib/credential/libsecret && \
make
#=============================================
# Fonts
#=============================================
RUN fc-cache -fv && \
apt-get install -y font-manager
#=============================================
# Samba
#=============================================
RUN apt-get install -y samba
#=============================================
# Build and install ttyd
#=============================================
RUN apt-get install -y cmake g++ pkg-config vim-common libwebsockets-dev libjson-c-dev libssl-dev \
&& cd /tmp \
&& git clone https://github.com/tsl0922/ttyd.git \
&& cd ttyd && mkdir build && cd build \
&& cmake .. \
&& make && make install \
&& rm -rf /tmp/ttyd
#=============================================
# Misc tools
#=============================================
# ripgrep
RUN curl -LO https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgrep_11.0.2_amd64.deb && sudo dpkg -i ripgrep_11.0.2_amd64.deb
# fzf
RUN cd /tmp && git clone --depth 1 https://github.com/junegunn/fzf.git && /tmp/fzf/install --bin && cp /tmp/fzf/bin/fzf /usr/bin/fzf && rm -rf /tmp/fzf
#=============================================
# Set root pwd
#=============================================
RUN echo "root:root" | chpasswd
#=============================================
# Copy and update misc config
#=============================================
COPY devbox-disk /
#=============================================
# Post process copied files
#=============================================
RUN chmod go-w /usr /usr/bin && find /usr/bin/ -name "*" -exec chmod a+x {} \;
RUN /usr/bin/config-append
RUN rm -rf /tmp/*
RUN apt-get install -y maven
#=============================================
# Bootstrap image
#=============================================
ENTRYPOINT bash -c /usr/bin/container-init.sh