@@ -48,6 +48,11 @@ RUN apt-get install -y --no-install-recommends \
4848RUN apt-get install -y --no-install-recommends openjdk-21-jre-headless
4949
5050RUN rm -rf /usr/local/WowzaStreamingEngine/java
51+
52+ # for some reason, OpenJDK's default directory includes the architecture
53+ # name and does not symlink it to something more straightforward like
54+ # /usr/lib/jvm/java-21-openjdk so we have to detect the architecture
55+
5156SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
5257RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) ln -s "/usr/lib/jvm/java-21-openjdk-${arch}" /usr/local/WowzaStreamingEngine/java
5358
@@ -81,7 +86,7 @@ RUN venv/bin/pip3 install unittest-xml-reporting
8186
8287COPY --chown=$APP_USER test /opt/app/test
8388
84- # Put artifacts where Jenkins can get at them
89+ # Put artifacts where Github Actions can get at them
8590RUN mkdir /opt/app/artifacts && \
8691 chown $APP_USER:$APP_USER /opt/app/artifacts
8792
@@ -95,6 +100,13 @@ RUN for app in vod live; \
95100 rm -r /usr/local/WowzaStreamingEngine/conf/${app}; \
96101 done
97102
103+ # modify supervisord configurations to run as $APP_USER
104+ # TODO: use templates to produce these files
105+ RUN sed -i "s/^user=root$/user=${APP_USER}/g" \
106+ /etc/supervisor/conf.d/WowzaStreamingEngine.conf \
107+ /etc/supervisor/conf.d/WowzaStreamingEngineManager.conf
108+ COPY etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
109+
98110# Copy our scripts, configs, templates, etc. into the container
99111COPY --chown=$APP_USER WowzaStreamingEngine /usr/local/WowzaStreamingEngine
100112COPY --chown=$APP_USER log4j-templates /opt/app/log4j-templates
@@ -135,11 +147,10 @@ RUN rm -r /opt/app/WEB-INF
135147# Uninstall zip
136148RUN apt-get remove -y zip
137149
138- # TODO: Fix this? Wowza's default image expects to run Wowza as root.
139150# =============================================================================
140- # Run as the wowza user to minimize risk to the host.
141-
142- # USER $APP_USER
151+ # Unlike most of our containers, this container starts as root as privileges
152+ # are dropped by supervisord instead of settingg the `USER` set in the
153+ # Dockerfile.
143154
144155# =============================================================================
145156# Default command
0 commit comments