Commit | Line | Data |
---|---|---|
08e44c41 JM |
1 | FROM ubuntu:14.04 |
2 | ||
3 | RUN apt-get -y update | |
4 | RUN apt-get -y install make cpp python | |
5 | ||
6 | RUN apt-get -y install curl | |
7 | RUN useradd -u 1000 -m -s /bin/bash -G sudo postgres | |
8 | ||
9 | ENV PG_VERSION=9.4 | |
10 | RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ | |
11 | echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' > /etc/apt/sources.list.d/pgdg.list && \ | |
12 | apt-get update && \ | |
13 | DEBIAN_FRONTEND=noninteractive apt-get -y install acl \ | |
14 | postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} && \ | |
15 | mkdir -p /var/run/postgresql/9.4-main.pg_stat_tmp/ && \ | |
7d93e812 | 16 | chown -R postgres.postgres /var/run/postgresql |
08e44c41 JM |
17 | |
18 | ENV HOME=/var/run/postgresql | |
19 | ||
68e4df99 JM |
20 | WORKDIR /mal |
21 | ||
7d93e812 JM |
22 | # Travis runs as user ID 1001 so add that user |
23 | RUN useradd -ou 1001 -m -s /bin/bash -G sudo,postgres travis | |
24 | # Enable postgres and travis users to sudo for postgres startup | |
25 | RUN echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers | |
26 | ||
08e44c41 JM |
27 | # Add entrypoint.sh which starts postgres then run bash/command |
28 | ADD entrypoint.sh /entrypoint.sh | |
67cc8a15 | 29 | ENTRYPOINT ["/entrypoint.sh"] |