Skip to content

Commit c9d0c31

Browse files
authored
Add RemoteIpValve to the server.xml in Docker image (#850)
1 parent b5dc009 commit c9d0c31

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

openam-distribution/openam-distribution-docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ RUN rm -rf $CATALINA_HOME/webapps/* \
2828
&& chmod -R g=u /usr/openam/ \
2929
&& useradd -m -r -u 1001 -g root $OPENAM_USER \
3030
&& install -d -o $OPENAM_USER $OPENAM_DATA_DIR \
31-
&& chown -R $OPENAM_USER:root $CATALINA_HOME
31+
&& chown -R $OPENAM_USER:root $CATALINA_HOME \
32+
&& sed -i '/<\/Host>/i \ \ \ \ <Valve className=\"org.apache.catalina.valves.RemoteIpValve\" httpServerPort=\"8080\" httpsServerPort=\"443\" />' $CATALINA_HOME/conf/server.xml
3233

3334
RUN apt-get remove -y --purge unzip \
3435
&& rm -rf /var/lib/apt/lists/*

openam-distribution/openam-distribution-docker/Dockerfile-alpine

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ RUN rm -rf $CATALINA_HOME/webapps/* \
2727
&& chmod -R g=u /usr/openam/ \
2828
&& adduser -S -u 1001 -G root $OPENAM_USER \
2929
&& install -d -o $OPENAM_USER $OPENAM_DATA_DIR \
30-
&& chown -R $OPENAM_USER:root $CATALINA_HOME/webapps
30+
&& chown -R $OPENAM_USER:root $CATALINA_HOME/webapps \
31+
&& sed -i '/<\/Host>/i \ \ \ \ <Valve className=\"org.apache.catalina.valves.RemoteIpValve\" httpServerPort=\"8080\" httpsServerPort=\"443\" />' $CATALINA_HOME/conf/server.xml
3132

3233
RUN apk del unzip && rm -rf /var/cache/apk/*
3334

0 commit comments

Comments
 (0)