Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 1 | # ============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 | |
| 19 | FROM centos:7.4.1708 |
| 20 | LABEL maintainer="maintainer" |
| 21 | |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 22 | # Install gcc |
| 23 | RUN yum install -y gcc python-devel |
| 24 | |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 25 | # Install jq |
| 26 | RUN curl -Ssf -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \ |
| 27 | && chmod +x /bin/jq |
| 28 | |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 29 | # Install pip and Cloudify CLI |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 30 | RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ |
| 31 | && python get-pip.py \ |
| 32 | && rm get-pip.py \ |
Jack Lucas | 4fbcea5 | 2020-08-31 11:01:04 -0400 | [diff] [blame] | 33 | && pip install cloudify==20.03.03 |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 34 | |
| 35 | # Copy scripts |
| 36 | RUN mkdir scripts |
| 37 | COPY scripts/ /scripts |
| 38 | |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 39 | # Load blueprints and input templates |
| 40 | COPY blueprints/ /blueprints |
| 41 | |
| 42 | # Set up runtime script |
| 43 | ENTRYPOINT exec "/scripts/bootstrap.sh" |
Jack Lucas | 879dbd6 | 2020-03-04 11:06:57 -0500 | [diff] [blame] | 44 | |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 45 | # Make scripts executable & set up a non-root user |
| 46 | RUN chmod +x /scripts/*.sh \ |
| 47 | && mkdir -p /opt/bootstrap \ |
Jack Lucas | 879dbd6 | 2020-03-04 11:06:57 -0500 | [diff] [blame] | 48 | && useradd -d /opt/bootstrap bootstrap \ |
| 49 | && chown -R bootstrap:bootstrap /opt/bootstrap \ |
| 50 | && chown -R bootstrap:bootstrap /scripts \ |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 51 | && chown -R bootstrap:bootstrap /blueprints |
| 52 | |
Jack Lucas | 879dbd6 | 2020-03-04 11:06:57 -0500 | [diff] [blame] | 53 | USER bootstrap |