From f98fde3d83a103126ae58b2b7c991b730e73a6e2 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 7 Jan 2018 01:33:09 +0100 Subject: [PATCH] Update Dockerfile - Switch to debian as base image - Reduce number of layers - Reduce image size Signed-off-by: Knut Ahlers --- Dockerfile | 40 +++++++++++--------------- scripts/docker-ts3.sh => docker-ts3.sh | 0 2 files changed, 16 insertions(+), 24 deletions(-) rename scripts/docker-ts3.sh => docker-ts3.sh (100%) mode change 100644 => 100755 diff --git a/Dockerfile b/Dockerfile index 0d484fd..9822ecf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,27 @@ -############################################### -# Ubuntu with added Teamspeak 3 Server. -# Uses SQLite Database on default. -############################################### +FROM debian -# Using latest Ubuntu image as base -FROM ubuntu:16.04 +LABEL maintainer Knut Ahlers -MAINTAINER Alex +ENV TEAMSPEAK_VERSION=3.0.13.8 \ + TEAMSPEAK_SHA256=460c771bf58c9a49b4be2c677652f21896b98a021d7fff286e59679b3f987a59 -RUN apt-get update \ - && apt-get install -y wget bzip2 --no-install-recommends \ - && rm -r /var/lib/apt/lists/* +RUN set -ex \ + && apt-get update \ + && apt-get install -y curl bzip2 --no-install-recommends \ + && curl -sSfLo teamspeak3-server_linux-amd64.tar.bz2 \ + http://dl.4players.de/ts/releases/${TEAMSPEAK_VERSION}/teamspeak3-server_linux_amd64-${TEAMSPEAK_VERSION}.tar.bz2 \ + && echo "${TEAMSPEAK_SHA256} *teamspeak3-server_linux-amd64.tar.bz2" | sha256sum -c - \ + && tar -C /opt -xjf teamspeak3-server_linux-amd64.tar.bz2 \ + && rm teamspeak3-server_linux-amd64.tar.bz2 \ + && apt-get purge -y curl bzip2 && apt-get autoremove -y \ + && rm -r /var/lib/apt/lists/* -## Set some variables for override. -# Download Link of TS3 Server -ENV TEAMSPEAK_VERSION 3.0.13.8 -ENV TEAMSPEAK_SHA256 460c771bf58c9a49b4be2c677652f21896b98a021d7fff286e59679b3f987a59 +ADD docker-ts3.sh /opt/docker-ts3.sh # Inject a Volume for any TS3-Data that needs to be persisted or to be accessible from the host. (e.g. for Backups) VOLUME ["/teamspeak3"] -# Download TS3 file and extract it into /opt. -RUN wget -O teamspeak3-server_linux-amd64.tar.bz2 http://dl.4players.de/ts/releases/${TEAMSPEAK_VERSION}/teamspeak3-server_linux_amd64-${TEAMSPEAK_VERSION}.tar.bz2 \ - && echo "${TEAMSPEAK_SHA256} *teamspeak3-server_linux-amd64.tar.bz2" | sha256sum -c - \ - && tar -C /opt -xjf teamspeak3-server_linux-amd64.tar.bz2 \ - && rm teamspeak3-server_linux-amd64.tar.bz2 - -ADD /scripts/ /opt/scripts/ -RUN chmod -R 774 /opt/scripts/ - -CMD ["/opt/scripts/docker-ts3.sh"] +CMD ["/opt/docker-ts3.sh"] # Expose the Standard TS3 port, for files, for serverquery EXPOSE 9987/udp 30033 10011 diff --git a/scripts/docker-ts3.sh b/docker-ts3.sh old mode 100644 new mode 100755 similarity index 100% rename from scripts/docker-ts3.sh rename to docker-ts3.sh