blob: b60863bb8e85f69240eecaf1c5c19add81441783 [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 Lucasbe3398d2021-02-15 19:19:40 -050037# Install rust (needed for "cryptography", needed for "cloudify"
38RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustinstall \
39&& chmod +x /rustinstall \
40&& /rustinstall -y
41
Jack Lucas01d60192020-06-17 17:11:17 -040042# Install pip and Cloudify CLI
Jack Lucasbe3398d2021-02-15 19:19:40 -050043RUN source /root/.cargo/env \
44&& pip install --upgrade pip \
45&& pip install cloudify==5.1.1
Jack Lucasbad77202020-02-03 18:21:29 -050046
47# Copy scripts
48RUN mkdir scripts
49COPY scripts/ /scripts
50
Jack Lucasbad77202020-02-03 18:21:29 -050051# Load blueprints and input templates
52COPY blueprints/ /blueprints
53
54# Set up runtime script
55ENTRYPOINT exec "/scripts/bootstrap.sh"
Jack Lucas879dbd62020-03-04 11:06:57 -050056
Jack Lucas01d60192020-06-17 17:11:17 -040057# Make scripts executable & set up a non-root user
58RUN chmod +x /scripts/*.sh \
59 && mkdir -p /opt/bootstrap \
Jack Lucasec990602021-01-13 12:50:10 -050060 && 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 Lucas01d60192020-06-17 17:11:17 -040065
Jack Lucasec990602021-01-13 12:50:10 -050066USER $user