Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 6b19971

Browse files
qwu16starwarfan
andauthored
Add user owt in Dockerfile (#773)
Co-authored-by: ChenLi <[email protected]>
1 parent 63985c6 commit 6b19971

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

doc/servermd/AnalyticsGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Start up MCU in Docker container:
135135

136136
````
137137
cd Release-vxxx
138-
./bin/init-all.sh --deps
138+
./bin/init-all.sh --deps ##default password for user owt is owt
139139
./bin/start-all.sh
140140
````
141141

docker/Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,18 @@ WORKDIR /home
220220
ARG NODE_VER=v10.21.0
221221
ARG NODE_REPO=https://nodejs.org/dist/${NODE_VER}/node-${NODE_VER}-linux-x64.tar.xz
222222

223-
COPY --from=owt-build /home/owt-server/dist /home/owt
224-
COPY startowt.sh /home/
225-
226-
RUN apt-get update && apt-get install -y -q --no-install-recommends ca-certificates wget xz-utils rabbitmq-server mongodb libboost-system-dev libboost-thread-dev liblog4cxx-dev libglib2.0-0 libfreetype6-dev curl
223+
RUN apt-get update && apt-get install -y -q --no-install-recommends ca-certificates wget xz-utils rabbitmq-server mongodb libboost-system-dev libboost-thread-dev liblog4cxx-dev libglib2.0-0 libfreetype6-dev curl sudo
227224

228225
RUN wget ${NODE_REPO} && \
229226
tar xf node-${NODE_VER}-linux-x64.tar.xz && \
230227
cp node-*/* /usr/local -rf && rm -rf node-*
231228

229+
RUN useradd -m owt && echo "owt:owt" | chpasswd && adduser owt sudo
230+
231+
COPY --chown=owt:owt --from=owt-build /home/owt-server/dist /home/owt
232+
COPY --chown=owt:owt startowt.sh /home/
233+
234+
USER owt
235+
236+
CMD /bin/bash
232237
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/x86_64-linux-gnu

docker/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ Note that `externalip` and `network_interface` should be both set if there are e
4444
a) Launch a Docker container with following command to simply try OWT:
4545
4646
```shell
47-
docker run -itd --name=owt --net=host owt:run /home/startowt.sh
47+
docker run -itd --name=owt --net=host owt:run bash
48+
docker exec -it owt bash
49+
cd /home/
50+
./startowt.sh ##default password for user owt is owt
4851
```
4952
Then OWT service should be launched and you can connect to https://localhost:3004 to start your OWT journey.
5053
5154
b) Launch OWT service with Docker swarm with script ```conference/build_server.sh```
5255
53-
c) Customize different OWT module images and launch OWT service with Kubernetes.
56+
c) Customize different OWT module images and launch OWT service with Kubernetes.

docker/gst-analytics.Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -521,19 +521,14 @@ ARG IE_DIR=/home/build/opt/intel/dldt/inference-engine
521521

522522
RUN mkdir -p ${IE_DIR}/include && \
523523
cp -r /opt/intel/openvino_2021/inference_engine/include/* ${IE_DIR}/include && \
524-
525524
mkdir -p ${IE_DIR}/lib/intel64 && \
526525
cp -r /opt/intel/openvino_2021/inference_engine/lib/intel64/* ${IE_DIR}/lib/intel64 && \
527-
528526
mkdir -p ${IE_DIR}/share && \
529527
cp -r /opt/intel/openvino_2021/inference_engine/share/* ${IE_DIR}/share/ && \
530-
531528
mkdir -p ${IE_DIR}/external/ && \
532529
cp -r /opt/intel/openvino_2021/inference_engine/external/* ${IE_DIR}/external && \
533-
534530
mkdir -p ${IE_DIR}/external/opencv && \
535531
cp -r /opt/intel/openvino_2021/opencv/* ${IE_DIR}/external/opencv/ && \
536-
537532
mkdir -p ${IE_DIR}/external/ngraph && \
538533
cp -r /opt/intel/openvino_2021/deployment_tools/ngraph/* ${IE_DIR}/external/ngraph/
539534

@@ -585,7 +580,7 @@ RUN cd ${SERVER_PATH} && ./scripts/build.js -t mcu -r -c && \
585580
FROM ubuntu:18.04 AS owt-run
586581
LABEL Description="This is the base image for GSTREAMER & DLDT Ubuntu 18.04 LTS"
587582
LABEL Vendor="Intel Corporation"
588-
WORKDIR /root
583+
WORKDIR /home
589584

590585
# Prerequisites
591586
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends \
@@ -612,14 +607,12 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-
612607
\
613608
libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev liba52-0.7.4-dev \
614609
\
615-
libva-dev libxrandr-dev libudev-dev liblog4cxx-dev gstreamer1.0-plugins-ugly rabbitmq-server mongodb \
610+
libva-dev libxrandr-dev libudev-dev liblog4cxx-dev gstreamer1.0-plugins-ugly rabbitmq-server mongodb sudo\
616611
\
612+
&& useradd -m owt && echo "owt:owt" | chpasswd && adduser owt sudo \
617613
&& rm -rf /var/lib/apt/lists/*
618614

619615
# Install
620-
COPY --from=dldt-build /home/build /
621-
COPY --from=gst-build /home/build /
622-
COPY --from=owt-build /home/owt-server/dist /home/owt
623616

624617
ARG LIBDIR=/usr/lib/x86_64-linux-gnu
625618

@@ -653,7 +646,10 @@ ARG SOURCE_REV
653646
ARG DLSTREAMER_VERSION=1.2.1
654647
ARG DLSTREAM_SOURCE_REPO=https://github.com/openvinotoolkit/dlstreamer_gst/archive/v${DLSTREAMER_VERSION}.tar.gz
655648

656-
COPY analyticspage /home/analyticspage
649+
COPY --chown=owt:owt --from=dldt-build /home/build /
650+
COPY --chown=owt:owt --from=gst-build /home/build /
651+
COPY --chown=owt:owt --from=owt-build /home/owt-server/dist /home/owt
652+
COPY --chown=owt:owt analyticspage /home/analyticspage
657653
ARG ENABLE_PAHO_INSTALLATION=false
658654
ARG ENABLE_RDKAFKA_INSTALLATION=false
659655
ARG BUILD_TYPE=Release
@@ -673,12 +669,14 @@ RUN wget ${DLSTREAM_SOURCE_REPO} && tar zxf v${DLSTREAMER_VERSION}.tar.gz && mv
673669
.. \
674670
&& make -j $(nproc) \
675671
&& make install \
676-
&& rm /root/v${DLSTREAMER_VERSION}.tar.gz
672+
&& rm /home/v${DLSTREAMER_VERSION}.tar.gz
677673

678674
RUN cp /home/analyticspage/index.js /home/owt/apps/current_app/public/scripts/ \
679675
&& cp /home/analyticspage/rest-sample.js /home/owt/apps/current_app/public/scripts/ \
680676
&& cp /home/analyticspage/index.html /home/owt/apps/current_app/public/ \
681677
&& cp /home/analyticspage/samplertcservice.js /home/owt/apps/current_app/
682678

683-
ENV GST_PLUGIN_PATH=/root/gst-video-analytics/
684-
ENV PYTHONPATH=/root/gst-video-analytics/python:$PYTHONPATH
679+
USER owt
680+
681+
ENV GST_PLUGIN_PATH=/home/gst-video-analytics/
682+
ENV PYTHONPATH=/home/gst-video-analytics/python:$PYTHONPATH

0 commit comments

Comments
 (0)