-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
24 lines (18 loc) · 980 Bytes
/
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
FROM debian:stable-slim
ARG CHECKMARX_STATE_PATH=/var/cxanalytix
ENV CHECKMARX_STATE_PATH=$CHECKMARX_STATE_PATH
COPY ./ App/
WORKDIR /App
RUN apt update && apt install -y xmlstarlet ca-certificates && \
mkdir -p /etc/cxanalytix && \
mkdir -p /var/cxanalytix && \
mkdir -p /var/log/cxanalytix && \
mv cxanalytix.config /etc/cxanalytix && \
mv cxanalytix.log4net /etc/cxanalytix && \
xmlstarlet ed -d "//root/appender-ref[@ref='RollingFile']" /etc/cxanalytix/cxanalytix.log4net > /etc/cxanalytix/logtmp.xml && \
rm -f /etc/cxanalytix/cxanalytix.log4net && \
mv /etc/cxanalytix/logtmp.xml /etc/cxanalytix/cxanalytix.log4net && \
for v in $(xmlstarlet sel -T -t -v "//appender/file[contains(@value, 'logs')]/@value" /etc/cxanalytix/cxanalytix.log4net); do export newv=$(echo $v | sed "s/logs\//\/var\/logs\/cxanalytix\//g"); sed -i "s.$v.$newv.g" /etc/cxanalytix/cxanalytix.log4net; done && \
apt remove -y xmlstarlet && \
apt clean
ENTRYPOINT ["./CxAnalytixDaemon"]