1 # ============LICENSE_START=======================================================
3 # ================================================================================
4 # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
20 LABEL maintainer="maintainer"
22 ENV DCAE_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}
23 ENV CCSDK_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}
24 ENV BP_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}
27 RUN yum install -y gcc python-devel
30 RUN yum install -y unzip \
31 && mkdir -p /opt/consul/bin \
32 && mkdir -p /opt/consul/data \
33 && mkdir -p /opt/consul/config \
34 && curl -Ssf https://releases.hashicorp.com/consul/1.2.1/consul_1.2.1_linux_amd64.zip > /tmp/consul.zip \
35 && unzip -pj /tmp/consul.zip > /opt/consul/bin/consul \
36 && chmod +x /opt/consul/bin/consul
37 COPY config/00-consul.json /opt/consul/config/
40 RUN curl -Ssf -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \
43 # Install pip and Cloudify CLI (stay at version 4.2 because of changes in higher versions)
44 RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
45 && python get-pip.py \
47 && pip install cloudify==4.2
51 COPY scripts/ /scripts
53 # Get plugins from raw repos
54 RUN scripts/load-plugins.sh ${DCAE_REPO} ${CCSDK_REPO} \
55 && rm scripts/load-plugins.sh \
56 # Make sure scripts are executable
57 && chmod +x /scripts/*.sh
59 # Load blueprints and input templates
60 COPY blueprints/ /blueprints
62 # Set up runtime script
63 ENTRYPOINT exec "/scripts/bootstrap.sh"
65 # Set up a non-root user
66 RUN mkdir -p /opt/bootstrap \
67 && useradd -d /opt/bootstrap bootstrap \
68 && chown -R bootstrap:bootstrap /opt/bootstrap \
69 && chown -R bootstrap:bootstrap /scripts \
70 && chown -R bootstrap:bootstrap /blueprints \
71 && chown -R bootstrap:bootstrap /opt/consul