summaryrefslogtreecommitdiffstats
path: root/kubernetes/dcae/pgaas/Dockerfile
blob: e1d147dfa9e8d314f51990bfeb5ba3f07bd2813a (plain)
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
FROM ubuntu:16.04

# Install additional packages
RUN apt-get update && apt-get -y install maven openjdk-8-jdk unzip python-pip curl dnsutils vim gawk wget openssh-client-ssh1
RUN pip install pyyaml

RUN apt-get update && apt-get install -y postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java
RUN rm -f /usr/sbin/policy-rc.d

# Install Groovy
RUN mkdir -p /opt/app
RUN (cd /opt/app ; curl -Lo apache-groovy-binary-2.4.6.zip https://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.6.zip )
RUN (cd /opt/app ; unzip apache-groovy-binary-2.4.6.zip )
RUN mkdir -p /opt/app/java/jdk
RUN ln -s /usr /opt/app/java/jdk/jdk170
RUN mkdir -p /opt/app/groovy
RUN ln -s /opt/app/groovy-2.4.6 /opt/app/groovy/246

# Create user dcae
RUN if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi

# Download required packages
RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-cdf_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-cdf_1.0.0.deb
RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-postgresql-prep_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-prep_1.0.0.deb
RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-postgresql-config_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-config_1.0.0.deb
RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-pgaas_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas_1.0.0.deb
RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-pgaas-post_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas-post_1.0.0.deb

RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /opt/tools
RUN mkdir -p /dbroot/pgdata
RUN mkdir -p /dbroot/pglogs

EXPOSE 5432

VOLUME /opt/tools
VOLUME /dbroot/pgdata
VOLUME /dbroot/pglogs

# Setup the entrypoint
COPY setup.sh /usr/local/bin/entrypoint.sh
RUN chmod a+x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["usr/local/bin/entrypoint.sh"]