-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (57 loc) · 3.62 KB
/
Dockerfile
File metadata and controls
78 lines (57 loc) · 3.62 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# syntax=docker/dockerfile:1.20
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2024 The MITRE Corporation. All Rights Reserved. #
#############################################################################
#############################################################################
# Copyright 2024 The MITRE 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. #
#############################################################################
ARG BUILD_REGISTRY
ARG BUILD_TAG=latest
FROM ${BUILD_REGISTRY}openmpf_cpp_component_build:${BUILD_TAG} AS build_component
RUN --mount=target=. build-component.sh
ARG RUN_TESTS=false
RUN if [ "${RUN_TESTS,,}" == true ]; then cd $BUILD_DIR/test && ./OcvDnnDetectionTest; fi
FROM ${BUILD_REGISTRY}openmpf_cpp_executor:${BUILD_TAG} AS ocv_dnn_component
COPY --from=build_component \
/usr/lib/x86_64-linux-gnu/libcudnn_ops.so.9.19.0 \
/usr/lib/x86_64-linux-gnu/libcudnn_cnn.so.9.19.0 \
/usr/lib/x86_64-linux-gnu/libcudnn_graph.so.9.19.0 \
/usr/lib/x86_64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.19.0 \
/usr/lib/x86_64-linux-gnu/libcudnn_engines_precompiled.so.9.19.0 \
/usr/lib/x86_64-linux-gnu/libcudnn_heuristic.so.9.19.0 \
/usr/lib/x86_64-linux-gnu/
COPY --from=build_component $BUILD_DIR/plugin/OcvDnnDetection $PLUGINS_DIR/OcvDnnDetection
COPY --from=build_component $BUILD_DIR/libmpfOcvDnnDetection.so $PLUGINS_DIR/OcvDnnDetection/lib/
ENV LD_LIBRARY_PATH=$PLUGINS_DIR/OcvDnnDetection/lib
LABEL org.label-schema.license="Mixed" \
org.label-schema.name="OpenMPF OpenCV Deep Neural Network (DNN) Classification" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://openmpf.github.io" \
org.label-schema.vcs-url="https://github.com/openmpf/openmpf-components" \
org.label-schema.vendor="MITRE"
FROM ocv_dnn_component AS sample_executable
COPY --from=build_component $BUILD_DIR/sample_ocv_dnn_classifier /opt/mpf/
COPY --from=build_component $BUILD_DIR/test/data /opt/mpf/test-data
RUN ln -s /opt/mpf/plugins /opt/mpf/plugin
ENV LD_LIBRARY_PATH=$PLUGINS_DIR/OcvDnnDetection/lib
ENTRYPOINT ["/opt/mpf/sample_ocv_dnn_classifier"]
# Set final image when no --target specified.
FROM ocv_dnn_component