diff --git a/docker/Dockerfile b/docker/Dockerfile index 3299f4b..acd6253 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,17 +1,28 @@ FROM ubuntu:latest + MAINTAINER Sah Lee -ENV PORT 8388 -EXPOSE $PORT - -ENV CONF /etc/shadowsocks.json -VOLUME ["/etc/shadowsocks.json"] - -CMD ssserver -p $PORT -c $CONF - +# Set up building environment RUN apt-get update RUN apt-get install -y git-core python python-setuptools + +# Get the latest code, build and install RUN git clone https://github.com/shadowsocks/shadowsocks.git RUN cd shadowsocks RUN python setup.py build RUN python setup.py install + +# Tear down building environment and delete git repository +RUN apt-get --purge autoremove -y git-core python python-setuptools +RUN cd .. +RUN rm -rf shadowsocks + +# Config file can be in a separated container +ENV CONF /etc/shadowsocks.json +VOLUME ["$CONF"] + +# Port in the config file won't take affect. Instead we'll use 8388. +ENV PORT 8388 +EXPOSE $PORT + +CMD ssserver -c $CONF -p $PORT