mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
make znc better
This commit is contained in:
parent
5263936bde
commit
9097087265
|
@ -7,29 +7,24 @@ RUN apt-get update && apt-get install -y \
|
|||
libperl-dev \
|
||||
pkg-config \
|
||||
curl \
|
||||
sudo \
|
||||
--no-install-recommends
|
||||
|
||||
ENV HOME /home/user
|
||||
RUN useradd --create-home --home-dir $HOME user \
|
||||
&& mkdir -p $HOME/.irssi \
|
||||
&& chown -R user:user $HOME
|
||||
|
||||
# get the source
|
||||
RUN mkdir /znc-tmp && \
|
||||
curl -sSL http://znc.in/releases/znc-latest.tar.gz | tar -v -C /znc-tmp -xz && \
|
||||
mv /znc-tmp/znc* /znc; rm -rf /znc-tmp && \
|
||||
cd /znc && \
|
||||
RUN mkdir $HOME/src && \
|
||||
curl -sSL http://znc.in/releases/znc-latest.tar.gz | tar -v -C $HOME/src -xz --strip-components 1 && \
|
||||
cd $HOME/src && \
|
||||
./configure && \
|
||||
make -j8 && \
|
||||
make install && \
|
||||
rm -rf /znc && \
|
||||
mkdir /znc
|
||||
rm -rf $HOME/src
|
||||
|
||||
COPY ./znc-shim /usr/local/bin/znc-shim
|
||||
WORKDIR $HOME
|
||||
USER user
|
||||
|
||||
RUN adduser \
|
||||
--system \
|
||||
--home=/znc \
|
||||
--shell=/bin/sh \
|
||||
--no-create-home \
|
||||
--group \
|
||||
znc
|
||||
|
||||
WORKDIR /znc
|
||||
ENTRYPOINT ["/usr/local/bin/znc-shim"]
|
||||
ENTRYPOINT [ "znc" ]
|
||||
CMD [ "-f" ]
|
||||
|
|
11
znc/znc-shim
11
znc/znc-shim
|
@ -1,11 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
ZNC_DIR="/znc"
|
||||
ZNC_OWNER=$(stat -c "%U" ${ZNC_DIR})
|
||||
|
||||
if [ "${ZNC_OWNER}" != "znc" ]; then
|
||||
chown -R znc:znc ${ZNC_DIR}
|
||||
fi
|
||||
|
||||
exec sudo -u znc "$@"
|
Loading…
Reference in New Issue
Block a user