Move plugin upload to CM container
[dcaegen2/deployments.git] / cm-container / Dockerfile-template
1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
16 FROM cloudifyplatform/community:19.01.24
17
18 ENV PLUGIN_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}
19
20 # Store plugin files locally
21 RUN mkdir scripts
22 COPY scripts/* scripts/
23 # Load our plugin files
24 # Setup rc.local to set up k8s credentials for CM
25 RUN scripts/get-plugins.sh ${PLUGIN_REPO} \
26     && chmod +x scripts/*.sh\
27     && /scripts/configure-tls.sh\
28     && echo "/scripts/setup-secret.sh" >> /etc/rc.d/rc.local\
29     && echo "/scripts/load-plugins.sh > /load-plugins.log 2>&1" >> /etc/rc.d/rc.local\
30     && chmod +x /etc/rc.d/rc.local
31 # Create mount point for CM config file
32 RUN mkdir -p /opt/onap && chown cfyuser:cfyuser /opt/onap
33
34 # Install jq (used for cleanup--parsing output of CM API call)
35 RUN curl -Ss -L -f "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"  > /bin/jq \
36 && chmod +x /bin/jq
37
38 CMD ["/scripts/start-persistent.sh"]