From dfec4cb946264527bbf85e078c09182acf1bfd51 Mon Sep 17 00:00:00 2001 From: adamus1red Date: Thu, 29 Oct 2020 09:54:45 +0000 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 51cc818..bfdb0a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,9 @@ RUN apk add --no-cache --virtual build ${PKG} \ && ./configure --prefix=/usr/local --sysconfdir=/hopm \ && make && make install \ && rm -rf /usr/src/hopm \ - && apk del build + && apk del build \ + && addgroup -S hopm && adduser -S hopm -G hopm + +USER hopm WORKDIR /hopm CMD ["/usr/local/bin/hopm", "-d"] From 0313c945f9d35ff0d12ac9fc4fcf6e16ca8526da Mon Sep 17 00:00:00 2001 From: adamus1red Date: Thu, 29 Oct 2020 12:46:59 +0000 Subject: [PATCH 2/2] fix issue affecting creation of hopm.pid --- Dockerfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index bfdb0a8..ea603bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +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 \ - && addgroup -S hopm && adduser -S hopm -G hopm - + && 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"]