Adding image download and scaling logic for enhancement #6

This commit is contained in:
Geoff Bourne 2014-11-09 16:27:05 +00:00
parent c324403f95
commit 5557f91c79
2 changed files with 18 additions and 3 deletions

View file

@ -2,23 +2,26 @@ FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
RUN apt-get install -y wget libmozjs-24-bin
RUN apt-get install -y wget libmozjs-24-bin imagemagick && apt-get clean
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
RUN wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk
RUN chmod +x /usr/bin/jsawk
RUN useradd -M -s /bin/false minecraft
RUN useradd -M -s /bin/false minecraft \
&& mkdir /data \
&& chown minecraft:minecraft /data
EXPOSE 25565
ADD start.sh /start
ADD start-minecraft.sh /start-minecraft
USER minecraft
VOLUME ['/data']
ADD server.properties /tmp/server.properties
WORKDIR /data
CMD [ "/start" ]
CMD [ "/start-minecraft" ]
ENV MOTD A Minecraft Server Powered by Docker
ENV LEVEL world

View file

@ -30,6 +30,18 @@ fi
if [ -n "$OPS" ]; then
echo $OPS | awk -v RS=, '{print}' >> ops.txt
fi
if [ -n "$ICON" ]; then
echo "Using server icon from $ICON..."
# Not sure what it is yet...call it "img"
wget -q -O /tmp/icon.img $ICON
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
if [ "$specs" = "PNG 64x64" ]; then
mv /tmp/icon.img /data/server-icon.png
else
echo "Converting image to 64x64 PNG..."
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
fi
fi
if [ ! -e /data/eula.txt ]; then
if [ "$EULA" != "" ]; then