-
Notifications
You must be signed in to change notification settings - Fork 214
/
Copy pathDockerfile.redhat
41 lines (37 loc) · 1.83 KB
/
Dockerfile.redhat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM registry.access.redhat.com/ubi8/ubi:8.10
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && yum update -d6 -y && yum install -d6 -y gcc-c++ curl xz
# OpenCV
WORKDIR /opt
COPY opencv_cmake_flags.txt /opt
COPY install_opencv.sh /opt
RUN ./install_opencv.sh
ARG OPS="-fpic -O2 -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -D_FORTIFY_SOURCE=1 -fno-strict-overflow -Wall -Wno-unknown-pragmas -Werror -Wno-error=sign-compare -fno-delete-null-pointer-checks -fwrapv -fstack-clash-protection -Wformat -Wformat-security -Werror=format-security"
ARG NODE_NAME=model_zoo_intel_object_detection
ARG NODE_TYPE=cpp
WORKDIR /
COPY ./queue.hpp ./queue.hpp
COPY ./common /custom_nodes/common
COPY ./${NODE_NAME} /custom_nodes/${NODE_NAME}/
COPY custom_node_interface.h /
WORKDIR /custom_nodes/common
RUN g++ -c -std=c++17 *.cpp ${OPS} -I/opt/opencv/include/opencv4/
WORKDIR /custom_nodes/${NODE_NAME}/
RUN mkdir -p /custom_nodes/lib
RUN g++ -c -std=c++17 ${NODE_NAME}.${NODE_TYPE} ${OPS} -I/opt/opencv/include/opencv4/
RUN g++ -shared ${OPS} -o /custom_nodes/lib/libcustom_node_${NODE_NAME}.so ${NODE_NAME}.o /custom_nodes/common/*.o \
-L/opt/opencv/lib/ -I/opt/opencv/include/opencv4/ -lopencv_core -lopencv_imgproc -lopencv_imgcodecs