mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-890: Merge support for running guacamole Docker image as non-root.
This commit is contained in:
@@ -56,6 +56,15 @@ WORKDIR /opt/guacamole
|
|||||||
# Copy artifacts from builder image into this image
|
# Copy artifacts from builder image into this image
|
||||||
COPY --from=builder /opt/guacamole/ .
|
COPY --from=builder /opt/guacamole/ .
|
||||||
|
|
||||||
|
# Create a new user guacamole
|
||||||
|
ARG UID=1001
|
||||||
|
ARG GID=1001
|
||||||
|
RUN groupadd --gid $GID guacamole
|
||||||
|
RUN useradd --system --create-home --shell /usr/sbin/nologin --uid $UID --gid $GID guacamole
|
||||||
|
|
||||||
|
# Run with user guacamole
|
||||||
|
USER guacamole
|
||||||
|
|
||||||
# Start Guacamole under Tomcat, listening on 0.0.0.0:8080
|
# Start Guacamole under Tomcat, listening on 0.0.0.0:8080
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD ["/opt/guacamole/bin/start.sh" ]
|
CMD ["/opt/guacamole/bin/start.sh" ]
|
||||||
|
@@ -716,9 +716,15 @@ associate_json() {
|
|||||||
##
|
##
|
||||||
start_guacamole() {
|
start_guacamole() {
|
||||||
|
|
||||||
|
# User-only writable CATALINA_BASE
|
||||||
|
export CATALINA_BASE=$HOME/tomcat
|
||||||
|
for dir in logs temp webapps work; do
|
||||||
|
mkdir -p $CATALINA_BASE/$dir
|
||||||
|
done
|
||||||
|
cp -R /usr/local/tomcat/conf $CATALINA_BASE
|
||||||
|
|
||||||
# Install webapp
|
# Install webapp
|
||||||
rm -Rf /usr/local/tomcat/webapps/${WEBAPP_CONTEXT:-guacamole}
|
ln -sf /opt/guacamole/guacamole.war $CATALINA_BASE/webapps/${WEBAPP_CONTEXT:-guacamole}.war
|
||||||
ln -sf /opt/guacamole/guacamole.war /usr/local/tomcat/webapps/${WEBAPP_CONTEXT:-guacamole}.war
|
|
||||||
|
|
||||||
# Start tomcat
|
# Start tomcat
|
||||||
cd /usr/local/tomcat
|
cd /usr/local/tomcat
|
||||||
|
Reference in New Issue
Block a user