blob: 14f8a6a27b2fc6b3c36bcfca4e909c4cd274b05a [file] [log] [blame]
mmisef24b052018-07-10 10:50:05 +01001#
2# Docker file to build an image that runs APEX on Java 8 in Ubuntu
3#
4FROM ubuntu:16.04
5
6RUN apt-get update && \
7 apt-get upgrade -y && \
8 apt-get install -y software-properties-common && \
9 add-apt-repository ppa:openjdk-r/ppa -y && \
10 apt-get update && \
11 apt-get install -y openjdk-8-jdk
12
13# Create apex user and group
14RUN groupadd apexuser
15RUN useradd --create-home -g apexuser apexuser
16
17# Add Apex-specific directories and set ownership as the Apex admin user
18RUN mkdir -p /opt/app/policy/apex-pdp
19RUN mkdir -p /var/log/onap/policy/apex-pdp
20RUN chown -R apexuser:apexuser /var/log/onap/policy/apex-pdp
21
22# Unpack the tarball
23RUN mkdir /packages
24COPY apex-pdp-package-full.tar.gz /packages
25RUN tar xvfz /packages/apex-pdp-package-full.tar.gz --directory /opt/app/policy/apex-pdp
26RUN rm /packages/apex-pdp-package-full.tar.gz
27
28# Ensure everything has the correct permissions
29RUN find /opt/app -type d -perm 755
30RUN find /opt/app -type f -perm 644
31RUN chmod a+x /opt/app/policy/apex-pdp/bin/*
32
33# Copy examples to Apex user area
34RUN cp -pr /opt/app/policy/apex-pdp/examples /home/apexuser
mmiseed7a082018-07-17 00:30:34 +010035
mmisef24b052018-07-10 10:50:05 +010036RUN apt-get clean
37
38RUN chown -R apexuser:apexuser /home/apexuser/*
mmiseed7a082018-07-17 00:30:34 +010039
40USER apexuser
41ENV PATH /opt/app/policy/apex-pdp/bin:$PATH
mmisef24b052018-07-10 10:50:05 +010042WORKDIR /home/apexuser