blob: 51c704c954c287ab6feef8f4d353f030995cf805 [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.
Jack Lucasec990602021-01-13 12:50:10 -05005# Copyright (c) 2021 J. F. Lucas. All rights reserved.
Jack Lucasbad77202020-02-03 18:21:29 -05006# ================================================================================
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 Lucasec990602021-01-13 12:50:10 -050020# 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
23FROM python:3.6-alpine
24LABEL maintainer="ONAP DCAE Team"
25LABEL Description="DCAE bootstrap image"
Jack Lucasbad77202020-02-03 18:21:29 -050026
Jack Lucasec990602021-01-13 12:50:10 -050027ARG user=onap
28ARG group=onap
29
30# Install packages needed for cloudify and for running bootstrap script
31RUN apk --no-cache add build-base libffi-dev openssl-dev curl bash
Jack Lucasbad77202020-02-03 18:21:29 -050032
Jack Lucasbad77202020-02-03 18:21:29 -050033# Install jq
34RUN curl -Ssf -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \
35&& chmod +x /bin/jq
36
Jack Lucas01d60192020-06-17 17:11:17 -040037# Install pip and Cloudify CLI
Jack Lucasec990602021-01-13 12:50:10 -050038RUN pip install cloudify==5.1.1
Jack Lucasbad77202020-02-03 18:21:29 -050039
40# Copy scripts
41RUN mkdir scripts
42COPY scripts/ /scripts
43
Jack Lucasbad77202020-02-03 18:21:29 -050044# Load blueprints and input templates
45COPY blueprints/ /blueprints
46
47# Set up runtime script
48ENTRYPOINT exec "/scripts/bootstrap.sh"
Jack Lucas879dbd62020-03-04 11:06:57 -050049
Jack Lucas01d60192020-06-17 17:11:17 -040050# Make scripts executable & set up a non-root user
51RUN chmod +x /scripts/*.sh \
52 && mkdir -p /opt/bootstrap \
Jack Lucasec990602021-01-13 12:50:10 -050053 && 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 Lucas01d60192020-06-17 17:11:17 -040058
Jack Lucasec990602021-01-13 12:50:10 -050059USER $user