aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend-init/Dockerfile
blob: 25e2e58ef56b545519a272afa12d6625aa3801dc (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
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM onap/integration-python:8.0.0

USER root

# Needed for pycurl
ENV PYCURL_SSL_LIBRARY=openssl

# Install packages only needed for building
RUN apk update && \
    apk add binutils jq libpng && \
    apk add --no-cache \
        libcurl \
        ruby && \
    apk add --no-cache --virtual .build-dependencies \
        libressl-dev \
        ruby-dev \
        libffi-dev \
        libxml2-dev \
        build-base \
        curl-dev && \
    # needed libcurl to install correctly \
    python -m pip install --upgrade pip \
    pip install 'pycurl==7.44.1' &&  \
    set -ex && \
    gem install public_suffix -v 4.0.7 --no-document && \
    gem install multipart-post -v 2.2.0 --no-document && \
    gem install etc -v 1.3.0 --no-document && \
    gem install bundler -v 2.3.26 --no-document && \
    gem install chef:13.8.5 berkshelf:6.3.1 io-console:0.4.6 webrick --no-document && \
    apk del .build-dependencies && \
    gem cleanup

ENV ONAP_LOG=/home/onap/logs
RUN mkdir $ONAP_LOG && chown onap:onap $ONAP_LOG

# user/group are the same as in integration/docker/onap-python base image
ENV user=onap group=onap

USER onap

# user/group args are inherited from base_sdc-python base image
COPY --chown=onap:onap scripts /home/onap/scripts

RUN chmod 770 -R /home/onap/scripts && \
    cd /home/onap/scripts && \
    python setup.py install --user

ENV PATH=$PATH:/home/onap/.local/bin

COPY --chown=onap:onap chef-solo /home/onap/chef-solo/
COPY --chown=onap:onap chef-repo/cookbooks /home/onap/chef-solo/cookbooks/
COPY --chown=onap:onap startup.sh /home/onap/

RUN chmod 770 /home/onap/startup.sh

WORKDIR /home/onap/

ENTRYPOINT /home/${user}/startup.sh