blob: 54609ca5f7902c0e4759b357a197994cb50a0bfd [file] [log] [blame]
Jack Lucasbad77202020-02-03 18:21:29 -05001# ============LICENSE_START=======================================================
2# org.onap.dcae
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
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
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=========================================================
18
19FROM centos:7.4.1708
20LABEL maintainer="maintainer"
21
22ENV DCAE_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}
23ENV CCSDK_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}
24ENV BP_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}
25
26# Install gcc
27RUN yum install -y gcc python-devel
28
29# Install Consul
30RUN 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
37COPY config/00-consul.json /opt/consul/config/
38
39# Install jq
40RUN curl -Ssf -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \
41&& chmod +x /bin/jq
42
43# Install pip and Cloudify CLI (stay at version 4.2 because of changes in higher versions)
44RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
45 && python get-pip.py \
46 && rm get-pip.py \
47 && pip install cloudify==4.2
48
49# Copy scripts
50RUN mkdir scripts
51COPY scripts/ /scripts
52
53# Get plugins from raw repos
54RUN 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
58
59# Load blueprints and input templates
60COPY blueprints/ /blueprints
61
62# Set up runtime script
63ENTRYPOINT exec "/scripts/bootstrap.sh"
Jack Lucas879dbd62020-03-04 11:06:57 -050064
65# Set up a non-root user
66RUN 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
72USER bootstrap