This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
/
Dockerfile
186 lines (156 loc) · 5.24 KB
/
Dockerfile
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# ====================
# Kurento Media Server
# ====================
#
# This Docker image is used to run an instance of Kurento Media Server.
#
#
#
# Build Command
# =============
#
# Run:
#
# docker build [Args...] --tag kurento/kurento-media-server:latest .
#
#
#
# Build Arguments
# ---------------
#
# --build-arg UBUNTU_CODENAME=<UbuntuCodename>
#
# <UbuntuCodename> is like "xenial", "bionic", etc.
#
# Optional. Default: "xenial".
#
# --build-arg KMS_VERSION=<KmsVersion>
#
# <KmsVersion> is like "6.7.2", "6.9.0", etc.
# Alternatively, "dev" is used to build a nightly version of KMS.
#
# Optional. Default: "dev".
#
# --build-arg APT_ARGS=<AptArguments>
#
# <AptArguments> is a string with arguments that will be passed to all
# executions of `apt-get`.
#
# Example: To Use an Apt package proxy
# Doc: http://manpages.ubuntu.com/manpages/bionic/en/man1/apt-transport-http.1.html#options
#
# APT_ARGS='-o Acquire::http::Proxy=http://user:pass@host:port/'
#
# Optional. Default: None.
#
#
#
# Run Command
# ===========
#
# Run:
#
# docker run --name kms -p 8888:8888 kurento/kurento-media-server:latest
#
# Then, you can follow the logs with the `docker logs` command:
#
# docker logs --follow kms >"kms-$(date '+%Y%m%dT%H%M%S').log" 2>&1
# Global arguments for FROM
ARG UBUNTU_CODENAME="xenial"
# Stage: Base system configuration
# ================================
FROM ubuntu:${UBUNTU_CODENAME} AS ubuntu_base
ARG APT_ARGS=""
# Configure Apt:
# * DEBIAN_FRONTEND: Disable Apt interactive questions and messages
# * --quiet: Hide progress bars.
# * --yes: Assume "Yes" for all confirmation requests.
# * APT::Install-Recommends=false: Avoid installing non-essential stuff.
RUN touch /etc/profile \
&& touch "$HOME"/.bash_profile \
&& printf "\
apt-get-install() {\n\
(\n\
export DEBIAN_FRONTEND=noninteractive\n\
/usr/bin/apt-get --quiet $APT_ARGS update \\\\\\n\
&& /usr/bin/apt-get --quiet --yes -oAPT::Install-Recommends=false $APT_ARGS install \"\$@\"\n\
)\n\
local RC=\$?\n\
rm -rf /var/lib/apt/lists/*\n\
return \$RC\n\
}\n" >>/etc/profile
# FIXME: Workaround for the network errors introduced by our OpenStack CI.
RUN printf "\
apt-get-install-fix() {\n\
(\n\
export DEBIAN_FRONTEND=noninteractive\n\
/usr/bin/apt-get --quiet update \\\\\\n\
&& until /usr/bin/apt-get --quiet --yes -oAPT::Install-Recommends=false install \"\$@\"; do echo FIXME RETRY; done\n\
)\n\
local RC=\$?\n\
rm -rf /var/lib/apt/lists/*\n\
return \$RC\n\
}\n" >>/etc/profile
SHELL ["/bin/bash", "--login", "-x", "-c"]
# Stage: Install and prepare
# ==========================
FROM ubuntu_base
LABEL maintainer="Juan Navarro <juan.navarro@gmx.es>"
ARG UBUNTU_CODENAME
ARG KMS_VERSION="dev"
# Configure environment:
# * LANG: Set the default locale for all commands
ENV LANG="C.UTF-8"
# Install required tools:
# * curl: For `healthchecker.sh`
# * dnsutils: For `dig` in `getmyip.sh`
# * gnupg: For `apt-key adv` (since Ubuntu 18.04)
RUN apt-get-install \
curl \
dnsutils \
gnupg
# Add Kurento Apt package repository.
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83 \
&& APT_LIST="deb [arch=amd64] http://ubuntu.openvidu.io/${KMS_VERSION} ${UBUNTU_CODENAME} kms6" \
&& echo "Apt source line: $APT_LIST" \
&& echo "$APT_LIST" >/etc/apt/sources.list.d/kurento.list
# Install Kurento Media Server
#RUN apt-get-install kurento-media-server
#
# FIXME: apt-get-install-fix is a workaround for the network errors introduced by our OpenStack CI.
RUN apt-get-install-fix kurento-media-server
# Install additional modules
# These might not be all available, so install separately and allow errors
RUN apt-get-install kms-chroma || true
RUN apt-get-install kms-crowddetector || true
RUN apt-get-install kms-datachannelexample || true
RUN apt-get-install kms-markerdetector || true
RUN apt-get-install kms-platedetector || true
RUN apt-get-install kms-pointerdetector || true
# Install additional tools that are indirectly used by some GStreamer plugins:
# * gstreamer1.5-tools: Allows running the command `gst-inspect-1.5`.
# Useful for troubleshooting and debugging installed GStreamer plugins.
# * gstreamer1.5-x: Video rendering plugins for X11 and Pango.
# Needed by some overlay elements like "textoverlay".
RUN apt-get-install \
gstreamer1.5-tools \
gstreamer1.5-x
# Install debug symbols
RUN apt-key adv \
--keyserver keyserver.ubuntu.com \
--recv-keys F2EDC64DC5AEE1F6B9C621F0C8CAB6595FDFF622 \
&& echo "deb http://ddebs.ubuntu.com ${UBUNTU_CODENAME} main restricted universe multiverse" >/etc/apt/sources.list.d/ddebs.list \
&& echo "deb http://ddebs.ubuntu.com ${UBUNTU_CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/ddebs.list \
&& apt-get-install-fix kurento-dbg
#
# FIXME: apt-get-install-fix is a workaround for the network errors introduced by our OpenStack CI.
# Configure environment for KMS.
# * Disable color in debug logs.
ENV GST_DEBUG_NO_COLOR=1
# Expose default Kurento RPC control port
EXPOSE 8888
COPY entrypoint.sh /
COPY getmyip.sh /
COPY healthchecker.sh /
HEALTHCHECK --start-period=15s --interval=30s --timeout=3s --retries=1 CMD /healthchecker.sh
ENTRYPOINT ["/entrypoint.sh"]