Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to run as non root #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
ARG PKG="git gcc make binutils libc6-compat g++ openssl-dev"
ARG UID=1001
ARG GID=1001

FROM alpine:3.12.1
ARG PKG
#COPY ./hopm /usr/src/hopm
ARG UID
ARG GID

WORKDIR /usr/src/hopm
RUN apk add --no-cache --virtual build ${PKG} \
RUN set -x \
&& apk add --no-cache --virtual build ${PKG} \
&& git clone --depth 1 https://github.com/ircd-hybrid/hopm.git /usr/src/hopm \
&& ./configure --prefix=/usr/local --sysconfdir=/hopm \
&& ./configure --prefix=/app --sysconfdir=/hopm \
&& make && make install \
&& rm -rf /usr/src/hopm \
&& apk del build
&& apk del build \
&& addgroup -g ${GID} -S hopm && adduser --uid ${UID} --home /hopm -S hopm -G hopm \
&& chown -R hopm:hopm /app

USER hopm
WORKDIR /hopm
CMD ["/usr/local/bin/hopm", "-d"]
CMD ["/app/bin/hopm", "-d"]