Skip to content

Commit 2801c6b

Browse files
dtrawinsmzegla
andauthored
CVS 46555 RedHat UBI base image (openvinotoolkit#458)
Co-authored-by: Miłosz Żeglarski <milosz.zeglarski@intel.com>
1 parent 34b6e2d commit 2801c6b

9 files changed

+317
-12
lines changed

Dockerfile.redhat

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
#
2+
# Copyright (c) 2020-2021 Intel Corporation
3+
#
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
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
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.
15+
#
16+
17+
ARG BASE_IMAGE=registry.access.redhat.com/ubi8/ubi:8.2
18+
FROM $BASE_IMAGE as base_build
19+
20+
LABEL version="1.0.0"
21+
22+
ARG PROJECT_NAME="OpenVINO Model Server 2021.2"
23+
24+
LABEL description=${PROJECT_NAME}
25+
26+
ARG ov_source_branch=releases/2021/2
27+
ARG ovms_metadata_file
28+
ARG ov_use_binary=1
29+
ARG DLDT_PACKAGE_URL
30+
ARG OPENVINO_NAME=${DLDT_PACKAGE_URL}
31+
ARG INSTALL_DIR=/opt/intel/openvino
32+
ARG TEMP_DIR=/tmp/openvino_installer
33+
ARG DL_INSTALL_DIR=/opt/intel/openvino/deployment_tools
34+
ARG DL_DIR=/tmp
35+
ARG JOBS
36+
ARG YUM_OV_PACKAGE=intel-openvino-runtime-centos7
37+
# build_type=[ opt, dbg ]
38+
ARG build_type=dbg
39+
ARG debug_bazel_flags=--strip=never\ --copt="-g"\ -c\ dbg
40+
41+
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && yum update -d6 -y && yum install -d6 -y \
42+
boost169-atomic \
43+
boost169-chrono \
44+
boost169-filesystem \
45+
boost169-program-options \
46+
boost169-thread \
47+
boost169-system \
48+
boost169-date-time \
49+
cmake3 \
50+
gcc-c++ \
51+
automake \
52+
autoconf \
53+
curl \
54+
gdb \
55+
git \
56+
libgusb.x86_64 \
57+
libusbx \
58+
libcurl-devel \
59+
libtool \
60+
libuuid-devel \
61+
libxml2-devel \
62+
make \
63+
patch \
64+
pkg-config \
65+
pulseaudio-libs \
66+
python2 \
67+
python2-pip \
68+
python2-devel \
69+
python2-setuptools \
70+
python2-virtualenv \
71+
python3 \
72+
python3-pip \
73+
python3-devel \
74+
python3-setuptools \
75+
python3-virtualenv \
76+
unzip \
77+
wget \
78+
which \
79+
yum-utils \
80+
unzip && \
81+
yum clean all
82+
83+
# Set up Bazel
84+
ENV BAZEL_VERSION 2.0.0
85+
WORKDIR /bazel
86+
RUN curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
87+
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
88+
chmod +x bazel-*.sh && \
89+
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
90+
cd / && \
91+
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
92+
93+
################### TAKE OPENVINO FROM A BINARY RELEASE - buildarg ov_use_binary=1 (DEFAULT) ##########
94+
WORKDIR /
95+
# OV toolkit package
96+
RUN if [ "$ov_use_binary" == "1" ] && [ "$DLDT_PACKAGE_URL" != "" ]; then true ; else exit 0 ; fi ; mkdir -p $TEMP_DIR && cd $TEMP_DIR/ && \
97+
wget $DLDT_PACKAGE_URL && \
98+
mkdir /opt/intel && \
99+
tar -zxf l_openvino_toolkit*.tgz -C /opt/intel && \
100+
ln -s /opt/intel/l_openvino_toolkit_runtime* /opt/intel/openvino
101+
102+
103+
# Build OpenVINO Model Server
104+
WORKDIR /ovms
105+
COPY .bazelrc WORKSPACE /ovms/
106+
COPY external /ovms/external/
107+
COPY third_party /ovms/third_party/
108+
109+
RUN alternatives --set python /usr/bin/python3
110+
RUN bazel build --jobs=$JOBS ${debug_bazel_flags} @org_tensorflow//tensorflow/core:framework
111+
RUN bazel build --jobs=$JOBS ${debug_bazel_flags} @tensorflow_serving//tensorflow_serving/apis:prediction_service_cc_proto
112+
113+
####### Azure SDK needs new boost:
114+
WORKDIR /boost
115+
RUN wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz && \
116+
tar xvf boost_1_68_0.tar.gz && cd boost_1_68_0 && ./bootstrap.sh && \
117+
./b2 cxxstd=17 link=static cxxflags='-fPIC' cflags='-fPIC' \
118+
--with-chrono --with-date_time --with-filesystem --with-program_options --with-system \
119+
--with-random --with-thread --with-atomic --with-regex \
120+
--with-log --with-locale \
121+
install
122+
123+
# OPENSSL
124+
WORKDIR /openssl
125+
126+
RUN git clone https://github.com/openssl/openssl && cd openssl && git checkout tags/OpenSSL_1_1_1h
127+
RUN cd openssl && ./config --prefix=/usr/local/ssl --openssldir=/etc/pki/tls shared && make --jobs=$JOBS && make --jobs=$JOBS install || true && make --jobs=$JOBS install_runtime
128+
129+
####### Azure SDK
130+
131+
WORKDIR /azure
132+
RUN git clone https://github.com/Microsoft/cpprestsdk.git && cd cpprestsdk && git checkout tags/v2.10.16 -b v2.10.16 && git submodule update --init
133+
134+
RUN git clone https://github.com/Azure/azure-storage-cpp.git && cd azure-storage-cpp/Microsoft.WindowsAzure.Storage && git checkout tags/v7.5.0 && mkdir build.release
135+
136+
WORKDIR /
137+
RUN cp -rf /ovms/third_party/cpprest/rest_sdk_v2.10.16.patch /azure/cpprestsdk/
138+
RUN cd /azure/cpprestsdk/ && patch -p1 < rest_sdk_v2.10.16.patch
139+
RUN cp -rf /ovms/third_party/azure/azure_sdk.patch /azure/azure-storage-cpp/
140+
RUN cd /azure/azure-storage-cpp/ && patch -p1 < azure_sdk.patch
141+
WORKDIR /azure
142+
143+
RUN cd cpprestsdk && mkdir Release/build.release && cd Release/build.release && cmake3 .. -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DBoost_USE_STATIC_LIBS=ON -DWERROR=OFF -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF && make --jobs=$JOBS install
144+
RUN cd azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release && CASABLANCA_DIR=/azure/cpprestsdk cmake3 .. -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DBoost_USE_STATIC_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=ON && make --jobs=$JOBS && make --jobs=$JOBS install
145+
146+
####### End of Azure SDK
147+
148+
# WARNING - do not move this install - needed here for proper ssl linkage in rest and azure
149+
RUN yum install -d6 -y openssl-devel
150+
151+
# Build AWS S3 SDK
152+
RUN git clone https://github.com/aws/aws-sdk-cpp.git --branch 1.7.129 --single-branch --depth 1 /awssdk
153+
WORKDIR /awssdk/build
154+
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY=s3 -DENABLE_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DMINIMIZE_SIZE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFORCE_SHARED_CRT=OFF -DSIMPLE_INSTALL=OFF -DCMAKE_CXX_FLAGS=" -D_GLIBCXX_USE_CXX11_ABI=1 " ..
155+
RUN make --jobs=$JOBS
156+
RUN mv .deps/install/lib64 .deps/install/lib
157+
158+
####### End of AWS S3 SDK
159+
160+
RUN cp -v /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
161+
162+
WORKDIR /ovms
163+
164+
COPY src/ /ovms/src/
165+
COPY release_files/ /ovms/release_files/
166+
167+
# Set OVMS version strings
168+
RUN bash -c "sed -i -e 's|REPLACE_PROJECT_NAME|${PROJECT_NAME}|g' /ovms/src/version.hpp"
169+
RUN if [ "$ov_use_binary" == "1" ] ; then true ; else exit 0 ; fi ; sed -i -e "s#REPLACE_OPENVINO_NAME#`find /opt/intel/ -maxdepth 1 -type d | grep openvino | cut -d'_' -f2`#g" /ovms/src/version.hpp
170+
171+
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/:/opt/intel/openvino/deployment_tools/ngraph/lib/:/opt/intel/openvino/inference_engine/external/tbb/lib/:/openvino/bin/intel64/Release/lib/
172+
173+
RUN bazel build ${debug_bazel_flags} --jobs $JOBS //src:ovms
174+
RUN bazel build ${debug_bazel_flags} --jobs $JOBS //src:libsampleloader.so
175+
176+
RUN cd /ovms/src/test/cpu_extension/ && make
177+
178+
RUN bazel test ${debug_bazel_flags} --jobs $JOBS --test_summary=detailed --test_output=all //src:ovms_test
179+
180+
COPY ${ovms_metadata_file} metadata.json
181+
182+
RUN ./bazel-bin/src/./ovms

DockerfileMakePackage

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARG BUILD_IMAGE=ovms-centos:latest
1919
FROM $BUILD_IMAGE
2020

2121
ARG ov_use_binary=1
22-
22+
RUN yum install -y xz
2323
RUN mkdir /patchelf && cd /patchelf && \
2424
wget https://github.com/NixOS/patchelf/archive/0.10.tar.gz && \
2525
tar -xf 0.10.tar.gz && ls -lah && cd */ && \
@@ -32,7 +32,7 @@ RUN mkdir -vp /ovms_release/lib/hddl/config
3232

3333
RUN cp /ovms/metadata.json /ovms_release/
3434
RUN if [ "$ov_use_binary" == "0" ] ; then true ; else exit 0 ; fi ; cp -v /openvino/bin/intel64/Release/lib/plugins.xml /ovms_release/lib/
35-
RUN if [ "$ov_use_binary" == "1" ] ; then true ; else exit 0 ; fi ; cp -v /opt/intel/openvino/deployment_tools/inference_engine/external/hddl/config/* /ovms_release/lib/hddl/config/
35+
RUN if [ "$ov_use_binary" == "1" ] ; then true ; else exit 0 ; fi ; cp -v /opt/intel/openvino/deployment_tools/inference_engine/external/hddl/config/* /ovms_release/lib/hddl/config/ || true
3636
RUN if [ "$ov_use_binary" == "1" ] ; then true ; else exit 0 ; fi ; cp -v /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/plugins.xml /ovms_release/lib/ && cp /opt/intel/openvino/install_dependencies/* /ovms_release/deps/
3737
RUN if [ "$ov_use_binary" == "1" ] ; then true ; else exit 0 ; fi ; rm -vrf /ovms_release/deps/*-devel-*
3838

Makefile

+14-6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ BASE_OS_TAG ?= latest
4040
BASE_OS_TAG_UBUNTU ?= 18.04
4141
BASE_OS_TAG_CENTOS ?= 7
4242
BASE_OS_TAG_CLEARLINUX ?= latest
43+
BASE_OS_TAG_REDHAT ?= 8.2
4344

4445
INSTALL_RPMS_FROM_URL ?=
4546

@@ -61,6 +62,11 @@ else
6162
BAZEL_DEBUG_FLAGS=" --strip=never "
6263
endif
6364

65+
# Option to Override release image.
66+
# Release image OS *must have* glibc version >= glibc version on BASE_OS:
67+
DIST_OS ?= $(BASE_OS)
68+
DIST_OS_TAG ?= $(BASE_OS_TAG)
69+
6470
ifeq ($(BASE_OS),ubuntu)
6571
BASE_OS_TAG=$(BASE_OS_TAG_UBUNTU)
6672
endif
@@ -70,11 +76,13 @@ endif
7076
ifeq ($(BASE_OS),clearlinux)
7177
BASE_OS_TAG=$(BASE_OS_TAG_CLEARLINUX)
7278
endif
73-
74-
# Option to Override release image.
75-
# Release image OS *must have* glibc version >= glibc version on BASE_OS:
76-
DIST_OS ?= $(BASE_OS)
77-
DIST_OS_TAG ?= $(BASE_OS_TAG)
79+
ifeq ($(BASE_OS),redhat)
80+
BASE_OS_TAG=$(BASE_OS_TAG_REDHAT)
81+
BASE_IMAGE=registry.access.redhat.com/ubi8/ubi:8.2
82+
DIST_OS=redhat
83+
DIST_OS_TAG=$(BASE_OS_TAG_REDHAT)
84+
DLDT_PACKAGE_URL=http://s3.toolbox.iotg.sclab.intel.com/ov-packages/l_openvino_toolkit_runtime_rhel8_p_2021.3.323.tgz
85+
endif
7886

7987
OVMS_CPP_DOCKER_IMAGE ?= openvino/model_server
8088
OVMS_CPP_IMAGE_TAG ?= latest
@@ -192,7 +200,7 @@ endif
192200
-t $(OVMS_CPP_DOCKER_IMAGE)-gpu:$(OVMS_CPP_IMAGE_TAG) && \
193201
docker tag $(OVMS_CPP_DOCKER_IMAGE)-gpu:$(OVMS_CPP_IMAGE_TAG) $(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)-gpu
194202
cd extras/nginx-mtls-auth && \
195-
http_proxy=$(HTTP_PROXY) https_proxy=$(HTTPS_PROXY) no_proxy=$(NO_PROXY) ./build.sh "$(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)" "$(OVMS_CPP_DOCKER_IMAGE)-nginx-mtls:$(OVMS_CPP_IMAGE_TAG)" && \
203+
http_proxy=$(HTTP_PROXY) https_proxy=$(HTTPS_PROXY) no_proxy=$(NO_PROXY) ./build.sh "$(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)" "$(OVMS_CPP_DOCKER_IMAGE)-nginx-mtls:$(OVMS_CPP_IMAGE_TAG)" "$(BASE_OS)" && \
196204
docker tag $(OVMS_CPP_DOCKER_IMAGE)-nginx-mtls:$(OVMS_CPP_IMAGE_TAG) $(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)-nginx-mtls
197205

198206
test_checksec:
File renamed without changes.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright (c) 2021 Intel Corporation
3+
#
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
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
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.
15+
#
16+
17+
ARG BASE_IMAGE=openvino/model_server:latest
18+
FROM $BASE_IMAGE
19+
USER root
20+
RUN set -e ; \
21+
set -x ; \
22+
mkdir /certs ; \
23+
microdnf install systemd wget; \
24+
rpm -Uv http://nginx.org/packages/mainline/centos/8/x86_64/RPMS/nginx-1.19.7-1.el8.ngx.x86_64.rpm ; \
25+
wget -O /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 ; \
26+
chmod +x /usr/bin/dumb-init ; \
27+
touch /run/nginx.pid ; mkdir -p /var/lib/nginx/tmp/ ; \
28+
chmod -R 777 /etc/nginx/conf.d/ /var/log/nginx/ /certs/ /var/lib/nginx/ /var/lib/nginx/tmp/ ; \
29+
sed -i 's,listen 80 default_server;,listen unix:/tmp/nginx-default.sock;,' /etc/nginx/nginx.conf ; \
30+
sed -i 's,listen \[::\]:80 default_server;,,' /etc/nginx/nginx.conf ; \
31+
sed -i 's,pid /run/nginx.pid;,pid /tmp/nginx.pid;,' /etc/nginx/nginx.conf ; \
32+
sed -i 's,user nginx;,,' /etc/nginx/nginx.conf ;
33+
34+
COPY ovms_wrapper /
35+
COPY model_server.conf.template /
36+
USER ovms
37+
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/ovms_wrapper"]
38+

extras/nginx-mtls-auth/build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
BASE_IMAGE=${1:-openvino/model_server:latest}
1919
OUTPUT_IMAGE=${2:-openvino/model_server:nginx-mtls}
20+
BASE_OS=${3:=centos}
2021

21-
docker build -f Dockerfile . --no-cache \
22+
docker build -f Dockerfile.$BASE_OS . --no-cache \
2223
--build-arg http_proxy="$http_proxy" --build-arg https_proxy="$https_proxy" \
2324
--build-arg no_proxy="$no_proxy" \
2425
--build-arg BASE_IMAGE="$BASE_IMAGE" \

release_files/Dockerfile.redhat

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# Copyright (c) 2020 Intel Corporation
3+
#
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
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
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.
15+
#
16+
17+
ARG BASE_IMAGE=registry.access.redhat.com/ubi8/ubi:8.2
18+
FROM $BASE_IMAGE as base_build
19+
RUN yum install -y xz
20+
WORKDIR /
21+
COPY ovms.tar.xz /
22+
RUN env
23+
RUN tar -xf ovms.tar.xz
24+
RUN groupadd --gid 5000 ovms && useradd --home-dir /home/ovms --create-home --uid 5000 \
25+
--gid 5000 --shell /bin/bash --skel /dev/null ovms && \
26+
chown -R ovms:ovms /ovms
27+
28+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
29+
30+
FROM registry.access.redhat.com/ubi8/ubi-minimal as release
31+
ARG INSTALL_RPMS_FROM_URL=
32+
ENV INSTALL_RPMS_FROM_URL=$INSTALL_RPMS_FROM_URL
33+
ARG GPU=1
34+
ENV GPU=$GPU
35+
WORKDIR /
36+
37+
RUN set -e ; \
38+
set -x ; \
39+
if [ "$GPU" == "1" ] ; then \
40+
mkdir /tmp/gpu_deps ; \
41+
curl -L -o /tmp/gpu_deps/intel-igc-core-1.0.2597-1.el7.x86_64.rpm https://sourceforge.net/projects/intel-compute-runtime/files/19.41.14441/centos-7/intel-igc-core-1.0.2597-1.el7.x86_64.rpm/download ; \
42+
curl -L -o /tmp/gpu_deps/intel-opencl-19.41.14441-1.el7.x86_64.rpm https://sourceforge.net/projects/intel-compute-runtime/files/19.41.14441/centos-7/intel-opencl-19.41.14441-1.el7.x86_64.rpm/download ; \
43+
curl -L -o /tmp/gpu_deps/intel-igc-opencl-devel-1.0.2597-1.el7.x86_64.rpm https://sourceforge.net/projects/intel-compute-runtime/files/19.41.14441/centos-7/intel-igc-opencl-devel-1.0.2597-1.el7.x86_64.rpm/download ; \
44+
curl -L -o /tmp/gpu_deps/intel-igc-opencl-1.0.2597-1.el7.x86_64.rpm https://sourceforge.net/projects/intel-compute-runtime/files/19.41.14441/centos-7/intel-igc-opencl-1.0.2597-1.el7.x86_64.rpm/download ; \
45+
curl -L -o /tmp/gpu_deps/intel-gmmlib-19.3.2-1.el7.x86_64.rpm https://sourceforge.net/projects/intel-compute-runtime/files/19.41.14441/centos-7/intel-gmmlib-19.3.2-1.el7.x86_64.rpm/download ; \
46+
curl -L -o /tmp/gpu_deps/intel-gmmlib-devel-19.3.2-1.el7.x86_64.rpm https://sourceforge.net/projects/intel-compute-runtime/files/19.41.14441/centos-7/intel-gmmlib-devel-19.3.2-1.el7.x86_64.rpm/download ; \
47+
cd /tmp/gpu_deps && rpm -iv *.rpm && rm -Rf /tmp/gpu_deps ; \
48+
fi ; \
49+
if [ "$INSTALL_RPMS_FROM_URL" == "" ] ; then \
50+
rpm -ivh http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/ocl-icd-2.2.12-1.el8.x86_64.rpm; \
51+
else \
52+
microdnf install tar gzip; \
53+
mkdir /tmp_ovms /src ; \
54+
cd /tmp_ovms ; \
55+
curl -L --fail -o deps.tar.xz "$INSTALL_RPMS_FROM_URL" ; \
56+
tar -xf deps.tar.xz ; \
57+
ls -Rahl . ; \
58+
mv -v pkg/src/*.src.rpm /src/ ; \
59+
rpm -vi pkg/bin/*.rpm ; \
60+
cd / ; \
61+
rm -rf /tmp_ovms ; \
62+
fi ; \
63+
microdnf install shadow-utils; \
64+
cp -v /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt ; \
65+
groupadd --gid 5000 ovms && useradd --home-dir /home/ovms --create-home --uid 5000 \
66+
--gid 5000 --shell /bin/bash --skel /dev/null ovms
67+
68+
COPY --from=base_build /ovms /ovms
69+
ENV LD_LIBRARY_PATH=/ovms/lib
70+
USER ovms
71+
ENTRYPOINT ["/ovms/bin/ovms"]

release_files/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ NOTE: If necessary, ensure that you have a `http_proxy` and `https_proxy` enviro
1313

1414
### Build image
1515

16+
CentOS base image:
17+
```bash
18+
make docker_build
19+
1620
```
17-
make centos
21+
RedHat base image:
22+
```bash
23+
make docker_build BASE_OS=redhat
1824
```
1925

2026
Image will be tagged ovms:latest.

src/test/ovmsconfig_test.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ TEST_F(OvmsParamsTest, hostname_ip_regex) {
186186
EXPECT_EQ(ovms::Config::instance().check_hostname_or_ip("example.com"), true);
187187
EXPECT_EQ(ovms::Config::instance().check_hostname_or_ip(" "), false);
188188
EXPECT_EQ(ovms::Config::instance().check_hostname_or_ip("(%$#*F"), false);
189-
std::string too_long = "";
190-
std::fill(too_long.begin(), too_long.begin() + 256, 'a');
189+
std::string too_long(256, 'a');
191190
EXPECT_EQ(ovms::Config::instance().check_hostname_or_ip(too_long), false);
192191
}
193192

0 commit comments

Comments
 (0)