Skip to content

Commit cdb2f4d

Browse files
committed
docker/release: update Dockerfile to follow best practice and use ubuntu xenial as base
1 parent 2cf25cc commit cdb2f4d

File tree

3 files changed

+29
-42
lines changed

3 files changed

+29
-42
lines changed

docker/release/Dockerfile

100644100755
Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Docker scripts for Smuxi
22
#
33
# Copyright (C) 2014 Carlos Hernandez <[email protected]>
4+
# Copytight (C) 2016 Pascal Bach <[email protected]>
45
#
56
# This program is free software; you can redistribute it and/or modify
67
# it under the terms of the GNU General Public License as published by
@@ -17,38 +18,32 @@
1718
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1819

1920
# Builds a docker image for smuxi
20-
FROM ubuntu:trusty
21-
MAINTAINER Carlos Hernandez <[email protected]>
22-
23-
# Let the container know that there is no tty
24-
ENV DEBIAN_FRONTEND noninteractive
25-
26-
# Set user nobody to uid and gid of unRAID
27-
RUN usermod -u 99 nobody
28-
RUN usermod -g 100 nobody
29-
30-
# Set locale
31-
ENV LANGUAGE en_US.UTF-8
32-
ENV LANG en_US.UTF-8
33-
RUN locale-gen en_US en_US.UTF-8
34-
RUN update-locale LANG=en_US.UTF-8
35-
RUN dpkg-reconfigure locales
21+
FROM ubuntu:xenial
22+
MAINTAINER Pascal Bach <[email protected]>
3623

3724
# Update Ubuntu
38-
RUN apt-get -q update
39-
RUN apt-mark hold initscripts udev plymouth mountall
40-
RUN apt-get -qy --force-yes dist-upgrade
41-
42-
# Install smuxi from apt
43-
RUN usermod -m -d /config nobody
44-
RUN apt-get install -qy --force-yes smuxi-engine
25+
RUN apt-get update && apt-get install -y \
26+
smuxi-engine\
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
# Add smuxi user
30+
RUN groupadd --system smuxi &&\
31+
useradd --system \
32+
--home /var/lib/smuxi \
33+
--create-home \
34+
--shell /usr/sbin/nologin \
35+
-g smuxi smuxi
4536

4637
ADD ./start.sh /start.sh
47-
ADD ./creds.conf /creds.conf
4838
RUN chmod a+x /start.sh
4939

50-
VOLUME /config
40+
ENV SMUXI_USER username
41+
ENV SMUXI_PASS password
42+
43+
VOLUME /var/lib/smuxi
44+
45+
EXPOSE 7689
5146

5247
# DON'T RUN AS ROOT
53-
USER nobody
48+
USER smuxi
5449
ENTRYPOINT ["/start.sh"]

docker/release/creds.conf

Lines changed: 0 additions & 2 deletions
This file was deleted.

docker/release/start.sh

100644100755
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
#! /bin/sh
22

3-
if [ ! -e /config/creds.conf ]; then
4-
cp /creds.conf /config/
5-
chown nobody:users /config/creds.conf
6-
chmod 755 /config/creds.conf
7-
fi
8-
9-
user=`grep -E '^user\s' /config/creds.conf | cut -f 2`
10-
pass=`grep -E '^pass\s' /config/creds.conf | cut -f 2`
11-
12-
if smuxi-server --list-users | grep -Fq "$user"
13-
then
14-
echo "User already exists."
3+
if smuxi-server --list-users | grep -Fq "$SMUXI_USER"
4+
then
5+
smuxi-server --modify-user --username="$SMUXI_USER" --password="$SMUXI_PASS"
156
else
16-
smuxi-server --add-user --username="$user" --password="$pass"
7+
smuxi-server --add-user --username="$SMUXI_USER" --password="$SMUXI_PASS"
178
fi
189

19-
smuxi-server
10+
# Make sure we listen on 0.0.0.0
11+
sed -i 's/BindAddress = 127.0.0.1/BindAddress = 0.0.0.0/g' ~/.config/smuxi/smuxi-engine.ini
12+
13+
smuxi-server -d

0 commit comments

Comments
 (0)