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 | be3398d | 2021-02-15 19:19:40 -0500 | [diff] [blame] | 37 | # Install rust (needed for "cryptography", needed for "cloudify" |
| 38 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustinstall \ |
| 39 | && chmod +x /rustinstall \ |
| 40 | && /rustinstall -y |
| 41 | |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 42 | # Install pip and Cloudify CLI |
Jack Lucas | be3398d | 2021-02-15 19:19:40 -0500 | [diff] [blame] | 43 | RUN source /root/.cargo/env \ |
| 44 | && pip install --upgrade pip \ |
| 45 | && pip install cloudify==5.1.1 |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 46 | |
| 47 | # Copy scripts |
| 48 | RUN mkdir scripts |
| 49 | COPY scripts/ /scripts |
| 50 | |
Jack Lucas | bad7720 | 2020-02-03 18:21:29 -0500 | [diff] [blame] | 51 | # Load blueprints and input templates |
| 52 | COPY blueprints/ /blueprints |
| 53 | |
| 54 | # Set up runtime script |
| 55 | ENTRYPOINT exec "/scripts/bootstrap.sh" |
Jack Lucas | 879dbd6 | 2020-03-04 11:06:57 -0500 | [diff] [blame] | 56 | |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 57 | # Make scripts executable & set up a non-root user |
| 58 | RUN chmod +x /scripts/*.sh \ |
| 59 | && mkdir -p /opt/bootstrap \ |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame] | 60 | && addgroup -S $group \ |
| 61 | && adduser -S -D -h /opt/bootstrap -s /bin/bash $user $group \ |
| 62 | && chown -R $user:$group /opt/bootstrap \ |
| 63 | && chown -R $user:$group /scripts \ |
| 64 | && chown -R $user:$group /blueprints |
Jack Lucas | 01d6019 | 2020-06-17 17:11:17 -0400 | [diff] [blame] | 65 | |
Jack Lucas | ec99060 | 2021-01-13 12:50:10 -0500 | [diff] [blame] | 66 | USER $user |