Browse Source

[docker] Use twisterd commandline as ENTRYPOINT instead of CMD

- allows running the container with additional command line parameters
miguelfreitas
Martin Honermeyer 11 years ago
parent
commit
915bebd288
  1. 2
      Dockerfile
  2. 9
      twister-on-docker

2
Dockerfile

@ -21,5 +21,5 @@ ENV HOME /root @@ -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

9
twister-on-docker

@ -11,6 +11,8 @@ REMOTE_IMAGE_NAME=mazzolino/twister @@ -11,6 +11,8 @@ REMOTE_IMAGE_NAME=mazzolino/twister
set -e
shift
case $ACTION in
build)
@ -20,12 +22,13 @@ 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) @@ -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"

Loading…
Cancel
Save