From bce9f99b0be317423e9b02b52d55e45826ae8e2b Mon Sep 17 00:00:00 2001 From: gar Date: Tue, 9 Aug 2016 20:47:09 -0700 Subject: [PATCH] Updating docker container with the new usage flag --- Dockerfile | 4 ++-- README.md | 27 ++++++++++++++++++++------- docker/run.sh | 11 ++--------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc19a48..2b929da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04.1 +FROM ubuntu:14.04.4 RUN apt-get update -y RUN apt-get install -y python-setuptools python-dev build-essential libffi-dev libssl-dev @@ -15,4 +15,4 @@ RUN chmod 777 /opt/run.sh EXPOSE 57575 -CMD ["/opt/run.sh"] \ No newline at end of file +ENTRYPOINT ["/opt/run.sh"] diff --git a/README.md b/README.md index 0cca3c2..faece1b 100644 --- a/README.md +++ b/README.md @@ -102,15 +102,28 @@ The js part is based on [term.js](https://github.com/chjj/term.js/) which is bas along with this program. If not, see . ``` -## Docker Usage +## Docker There is a docker repository created for this project that is set to automatically rebuild when there is a push into this repository: https://registry.hub.docker.com/u/garland/butterfly/ -### Starting +### Example usage - docker run \ - --env PASSWORD=password \ - --env PORT=57575 \ - -p 57575:57575 \ - -d garland/butterfly +Starting with login and password +``` +docker run \ +--env PASSWORD=password \ +--env PORT=57575 \ +-p 57575:57575 \ +-d garland/butterfly --unsecure --host=0.0.0.0 --port=57575 --login +``` + +Starting with no password + +``` +docker run \ +--env PASSWORD=password \ +--env PORT=57575 \ +-p 57575:57575 \ +-d garland/butterfly --unsecure --host=0.0.0.0 --port=57575 --login +``` diff --git a/docker/run.sh b/docker/run.sh index 4b4e7ec..b7e11f9 100644 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,13 +1,6 @@ -#!/bin/sh +#!/bin/sh -x # Set password echo "root:${PASSWORD}" | chpasswd -if [ -z ${PORT} ] -then - echo "Starting on default port: 57575" - /opt/app/butterfly.server.py --unsecure --host=0.0.0.0 -else - echo "Starting on port: ${PORT}" - /opt/app/butterfly.server.py --unsecure --host=0.0.0.0 --port=${PORT} -fi \ No newline at end of file +/opt/app/butterfly.server.py $@