2 ## Copyright (c) 2019 Intel Corporation
4 ## Licensed under the Apache License, Version 2.0 (the "License");
5 ## you may not use this file except in compliance with the License.
6 ## You may obtain a copy of the License at
8 ## http://www.apache.org/licenses/LICENSE-2.0
10 ## Unless required by applicable law or agreed to in writing, software
11 ## distributed under the License is distributed on an "AS IS" BASIS,
12 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ## See the License for the specific language governing permissions and
14 ## limitations under the License.
17 ##################################################
18 # Build all components in separate builder image #
19 ##################################################
20 FROM centos:7 as builder
22 ARG BUILD_DIR=/opt/rapid
24 COPY ./port_info ${BUILD_DIR}/port_info
26 COPY ./deploycentostools.sh ${BUILD_DIR}/
27 RUN chmod +x ${BUILD_DIR}/deploycentostools.sh \
28 && ${BUILD_DIR}/deploycentostools.sh -k deploy
30 #############################
31 # Create slim runtime image #
32 #############################
35 ARG BUILD_DIR=/opt/rapid
37 COPY ./deploycentostools.sh ${BUILD_DIR}/
38 COPY --from=builder ${BUILD_DIR}/install_components.tgz ${BUILD_DIR}/install_components.tgz
40 RUN chmod a+rwx ${BUILD_DIR} && chmod +x ${BUILD_DIR}/deploycentostools.sh \
41 && ${BUILD_DIR}/deploycentostools.sh -k runtime_image
43 # Expose SSH and PROX ports
47 COPY ./rapid_rsa_key.pub /home/centos/.ssh/authorized_keys
48 COPY ./rapid_rsa_key.pub /root/.ssh/authorized_keys
51 COPY ./start.sh /start.sh
52 RUN chmod +x /start.sh
54 ENTRYPOINT ["/start.sh"]