Switched to non-root user

This commit is contained in:
Jonathan Ervine 2020-07-27 22:14:59 +08:00
parent 5cfe2f1a78
commit e0b1fad0f8
3 changed files with 12 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# Base on latest (edge) alpine image
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11
FROM harbor.ervine.dev/public/x86_64/alpine:v3.12
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
@ -7,7 +7,11 @@ MAINTAINER “Jonathan Ervine” <docker@ervine.org>
ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US.UTF-8' \
TERM='xterm' \
VERSION='2.25.0'
VERSION='2.25.0' \
HYDRA_USER=hydra \
HYDRA_UID=1003 \
HYDRA_GID=1003
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
apk update && \
@ -18,10 +22,12 @@ RUN wget https://github.com/theotherp/nzbhydra2/releases/download/v$VERSION/nzbh
mkdir /nzbhydra && \
unzip /nzbhydra.zip -d /nzbhydra && \
chmod 755 /nzbhydra/nzbhydra2 && \
rm -rf /nzbhydra.zip /tmp/src /var/cache/apk/*
rm -rf /nzbhydra.zip /tmp/src /var/cache/apk/* && \
addgroup -g $HYDRA_GID $HYDRA_USER && \
adduser -D -u $HYDRA_UID -G $HYDRA_USER -H $HYDRA_USER
EXPOSE 5076
COPY start.sh /usr/local/bin/start.sh
VOLUME /config
WORKDIR /nzbhydra
CMD [ "/usr/local/bin/start.sh" ]
CMD [ "/usr/bin/python3", "nzbhydra2wrapperPy3.py", "--nobrowser", "--datafolder=/config/" ]

2
Jenkinsfile vendored
View File

@ -28,7 +28,7 @@ spec:
stage('Build with Kaniko') {
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-nzbhydra.git', credentialsId: 'jenkins-to-git'
container('kaniko') {
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/nzbhydra2:2.25.0 --destination=harbor.ervine.dev/library/x86_64/alpine/nzbhydra2:2.25 --destination=harbor.ervine.dev/library/x86_64/alpine/nzbget2:2'
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=false --destination=harbor.ervine.dev/library/x86_64/alpine/nzbhydra2:2.25.0 --destination=harbor.ervine.dev/library/x86_64/alpine/nzbhydra2:2.25 --destination=harbor.ervine.dev/library/x86_64/alpine/nzbget2:2 --destination=harbor.ervine.dev/public/x86_64/alpine/nzbhydra2:v2.25.0 --destination=harbor.ervine.dev/public/x86_64/alpine/nzbhydra2:v2.25'
}
}
}

BIN
hydra.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB