-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·61 lines (49 loc) · 1.93 KB
/
Dockerfile
File metadata and controls
executable file
·61 lines (49 loc) · 1.93 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
FROM ubuntu:xenial
ARG PG_VER=9.6
ARG RUST_VER=1.16.0
ENV USER root
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
software-properties-common \
python-software-properties \
wget \
pkg-config
RUN add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
musl-tools \
clang \
libclang-dev \
git \
libssl-dev \
bc \
gcc \
sudo \
vim \
postgresql-client-${PG_VER} \
postgresql-server-dev-${PG_VER} \
postgresql-contrib-${PG_VER}
RUN curl -sO https://static.rust-lang.org/dist/rust-${RUST_VER}-x86_64-unknown-linux-gnu.tar.gz && \
tar -xzf rust-${RUST_VER}-x86_64-unknown-linux-gnu.tar.gz && \
./rust-${RUST_VER}-x86_64-unknown-linux-gnu/install.sh --without=rust-docs && \
curl -sO https://static.rust-lang.org/dist/rust-std-${RUST_VER}-x86_64-unknown-linux-musl.tar.gz && \
tar -xzf rust-std-${RUST_VER}-x86_64-unknown-linux-musl.tar.gz && \
./rust-std-${RUST_VER}-x86_64-unknown-linux-musl/install.sh --without=rust-docs
RUN rm -rf \
rust-std-${RUST_VER}-x86_64-unknown-linux-musl \
rust-${RUST_VER}-x86_64-unknown-linux-gnu \
rust-std-${RUST_VER}-x86_64-unknown-linux-musl.tar.gz \
rust-${RUST_VER}-x86_64-unknown-linux-gnu.tar.gz \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
ADD . /tmp/code
WORKDIR /tmp/code
USER postgres
RUN echo "local all postgres trust" > /etc/postgresql/${PG_VER}/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/${PG_VER}/main/postgresql.conf
RUN /etc/init.d/postgresql start