From 0bf342643e19f5d2bffa7cac78be8847ce422e0f Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Wed, 23 Dec 2015 09:40:17 -0700 Subject: [PATCH] Use static version number --- Dockerfile | 8 +++++--- build.sh | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 053dcde..d074a52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM alpine:3.2 MAINTAINER Chris Kankiewicz +# Define Mumble version +ENV MUMBLE_VERSION 1.2.12 + # Create Mumble directories ENV MUMBLE_DIR /opt/mumble ENV CONFIG_DIR /srv/mumble @@ -15,12 +18,11 @@ COPY files/update-pw ${SCRIPTS_DIR}/update-pw RUN chmod +x ${SCRIPTS_DIR}/update-pw # Install dependencies -RUN apk add --update ca-certificates bzip2 jq tar wget \ +RUN apk add --update ca-certificates bzip2 tar wget \ && rm -rf /var/cache/apk/* # Download and extract Mumble -RUN MUMBLE_VERSION=$(wget -qO- https://api.github.com/repos/mumble-voip/mumble/releases | jq -r '.[0].tag_name') \ - && wget -qO- https://github.com/mumble-voip/mumble/releases/download/${MUMBLE_VERSION}/murmur-static_x86-${MUMBLE_VERSION}.tar.bz2 \ +RUN wget -qO- https://github.com/mumble-voip/mumble/releases/download/${MUMBLE_VERSION}/murmur-static_x86-${MUMBLE_VERSION}.tar.bz2 \ | tar -xjv --strip-components=1 -C ${MUMBLE_DIR} # Expose ports diff --git a/build.sh b/build.sh index c090991..78d493a 100755 --- a/build.sh +++ b/build.sh @@ -7,8 +7,11 @@ IMAGE_NAME="phlak/mumble" # Set script directory path SCRIPT_DIR="$(dirname $(readlink -f ${0}))" +# Set image tag +TAG="$(grep 'ENV MUMBLE_VERSION' Dockerfile | awk '{print $3}')" + # Build the image -docker build --force-rm --pull --tag ${IMAGE_NAME}:local ${SCRIPT_DIR} +docker build --force-rm --pull --tag ${IMAGE_NAME}:${TAG} ${SCRIPT_DIR} # Notify user of success -echo "Sucessfully created image: ${IMAGE_NAME}:local" +echo "Sucessfully created image: ${IMAGE_NAME}:${TAG}"