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. |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame^] | 5 | # Copyright (c) 2021 J. F. Lucas. All rights reserved. |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 6 | # ================================================================================ |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # ============LICENSE_END========================================================= |
| 19 | |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame^] | 20 | # cloudify CLI requires python 3.6 |
| 21 | # won't work with 3.7 or later, hence won't work |
| 22 | # with the ONAP integration-python base images |
| 23 | FROM python:3.6-alpine |
| 24 | LABEL maintainer="ONAP DCAE Team" |
| 25 | LABEL Description="DCAE bootstrap image" |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 26 | |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame^] | 27 | ARG user=onap |
| 28 | ARG group=onap |
| 29 | |
| 30 | # Install packages needed for cloudify and for running bootstrap script |
| 31 | RUN apk --no-cache add build-base libffi-dev openssl-dev curl bash |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 32 | |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 33 | # Install jq |
| 34 | RUN curl -Ssf -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \ |
| 35 | && chmod +x /bin/jq |
| 36 | |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 37 | # Install pip and Cloudify CLI |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame^] | 38 | RUN pip install cloudify==5.1.1 |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 39 | |
| 40 | # Copy scripts |
| 41 | RUN mkdir scripts |
| 42 | COPY scripts/ /scripts |
| 43 | |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 44 | # Load blueprints and input templates |
| 45 | COPY blueprints/ /blueprints |
| 46 | |
| 47 | # Set up runtime script |
| 48 | ENTRYPOINT exec "/scripts/bootstrap.sh" |
Jack Lucas | 879dbd6 | 2020-03-04 11:06:57 -0500 | [diff] [blame] | 49 | |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 50 | # Make scripts executable & set up a non-root user |
| 51 | RUN chmod +x /scripts/*.sh \ |
| 52 | && mkdir -p /opt/bootstrap \ |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame^] | 53 | && addgroup -S $group \ |
| 54 | && adduser -S -D -h /opt/bootstrap -s /bin/bash $user $group \ |
| 55 | && chown -R $user:$group /opt/bootstrap \ |
| 56 | && chown -R $user:$group /scripts \ |
| 57 | && chown -R $user:$group /blueprints |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 58 | |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame^] | 59 | USER $user |