-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (77 loc) · 2.35 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
85
86
FROM buildpack-deps:stretch
# Setup .bashrc
SHELL ["/bin/bash", "-lc"]
COPY extra.bashrc /tmp
RUN cat /tmp/extra.bashrc | tee -a /root/.bashrc
# Update and install some tools useful for debugging in production
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
apt-utils \
&& \
dpkg --configure -a && \
apt-get upgrade -y && \
apt-get install -y \
build-essential \
procps \
sysstat \
htop \
net-tools \
dnsutils \
tcpdump \
python-pip \
python-openssl \
gnupg \
rsync \
# These need `--cap-add SYS_PTRACE`, and maybe `--security-opt seccomp:unconfined`
strace \
ltrace \
&& \
apt-get autoremove -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install awscli
# Pre-setup some Golang
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && \
chmod -R 777 "$GOPATH"
# Pre-setup some Nginx
RUN set -x && \
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \
NGINX_GPGFOUND=''; \
for server in \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo "Fetching GPG key $NGINX_GPGKEY from $server"; \
apt-key adv --keyserver "$server" --recv-keys "$NGINX_GPGKEY" && NGINX_GPGFOUND=yes && break; \
done; \
test -z "$NGINX_GPGFOUND" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \
echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx" >> /etc/apt/sources.list
# Pre-setup some Node
RUN mkdir -p /usr/src/app && \
chmod -R 777 /usr/src/app
# Install nvm
ENV NVM_VERSION 0.33.8
ENV NVM_DIR /usr/local/nvm
RUN curl -o- "https://raw.githubusercontent.com/creationix/nvm/v$NVM_VERSION/install.sh" | NVM_DIR=$NVM_DIR bash
COPY default-packages $NVM_DIR
# Copy install scripts to root
COPY install*.sh /
# HACK - Load extra env vars
# RUN rm -f /bin/sh
# COPY sh.sh /bin/sh
# Automatically update packages in child images
ONBUILD ARG DEBIAN_FRONTEND=noninteractive
ONBUILD RUN \
apt-get update && \
apt-get upgrade -y && \
apt-get autoremove -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install --upgrade awscli