[docker] Use twisterd commandline as ENTRYPOINT instead of CMD

- allows running the container with additional command line parameters
This commit is contained in:
Martin Honermeyer 2014-07-03 00:30:24 +02:00
parent 6fd09eba18
commit 915bebd288
2 changed files with 7 additions and 4 deletions

View File

@ -21,5 +21,5 @@ ENV HOME /root
VOLUME /root/.twister
# Run twisterd by default
CMD ["/twister-core/twisterd", "-rpcuser=user", "-rpcpassword=pwd", "-rpcallowip=172.17.42.1", "-htmldir=/twister-html", "-printtoconsole"]
ENTRYPOINT ["/twister-core/twisterd", "-rpcuser=user", "-rpcpassword=pwd", "-rpcallowip=172.17.42.1", "-htmldir=/twister-html", "-printtoconsole"]
EXPOSE 28332

View File

@ -11,6 +11,8 @@ REMOTE_IMAGE_NAME=mazzolino/twister
set -e
shift
case $ACTION in
build)
@ -20,12 +22,13 @@ build)
run)
if [ $MODE == "--remote" ]; then
shift
IMAGE_NAME=$REMOTE_IMAGE_NAME
echo Pulling new version of $IMAGE_NAME
docker pull $IMAGE_NAME
fi
echo Running $IMAGE_NAME
docker run -d -p 28332:28332 -v $HOME/.twister:/root/.twister $IMAGE_NAME
docker run -d -p 28332:28332 -v $HOME/.twister:/root/.twister $IMAGE_NAME "$@"
echo Twister should now be running at http://localhost:28332
;;
@ -40,10 +43,10 @@ stop)
*)
echo Usage:
echo " $0 run"
echo " $0 run [ARGS FOR TWISTERD..]"
echo " Run twister from a local docker build (default)"
echo
echo " $0 run --remote"
echo " $0 run --remote [ARGS FOR TWISTERD..]"
echo " Run twister from the remote docker build at \"$REMOTE_IMAGE_NAME\""
echo
echo " $0 build"