Getting docker working in daemon mode for a tahoe-lafs storage node?

Right now, for my workflow (personal project, but for sharing with friends I would like to simplfy it), I have the steps:
1. docker run -it -p 3456:3456 -p 39499:39499 maccam912/tahoe-node /bin/bash
2. In docker, run the script which will either do a first-time configuration, or just run the tahoe service if it is not the first run.

My question is how I would simplify this. A few specific points below:

  • How to assign a name to running container in docker?
  • Docker volume, change file permissions/owner
  • output in docker quickstart terminal become garbled
  • How to get stdin from php for java docker container at runtime
  • Docker output of exec command in detach mode
  • Where to find geard deployment fixture/config documentation?
  • I would like to tell docker to just run the container and let it do its thing in the background. if I changed it by replacing the -it with -d I understand that would get me closer, but it never seems to leave anything running when I do a docker ps the same way the above workflow does, and then me detaching with CTRL+P, CTRL+Q.

    Do I need to -p those ports? I EXPOSE them in the Dockerfile. Also, since they are being mapped directly to the same port in the container, do I need to write each twice? Those ports are what the container is using AND what the outside world is expecting to be able to use to connect to the tahoe “server”.

    How could I get this working so that instead of running /bin/bash I run / right away?

    My perfect command would look something like docker run -d maccam912/tahoe-node / if the port mapping stuff is not necessary. The end goal of this would be to let the container run in the background, with kicking off a server that just runs “forever”.

    Let me know if I can clarify anything or if there is a simpler way to do this. Feel free to take a look at my Dockerfile and make any suggestions if it would simplify things there, but this project is intentionally following ease of use (hopefully getting things down to 1 command) over separation of duties, as is recommended.

  • How to start and register a chaincode of Hyperledger on Windows10
  • How to access tomcat running in docker container from browser?
  • Increase the disk size of docker (Error: Insufficient space)
  • Best way for debugging docker build error
  • get the url to connect to marathon app via jdbc
  • Using host env variable with docker remote API
  • One Solution collect form web for “Getting docker working in daemon mode for a tahoe-lafs storage node?”

    I do believe I figured it out:

    The problem with having just -d specified is that as soon as the command given returns/exits, the container stops running. My solution was to end the last line with a &, leaving the script hanging and not exiting.

    As for the ports, the EXPOSE in the Dockerfile does nothing more than make those ports available to the host machine, not to remote machines like a server would need. the -p is still necessary. The doubling of the ports (in:out) is needed because specifying only one will map that port to a random high numbered port in the container.

    Please correct me if I’m wrong on any of this, but in this case the best solution was to modify my script, and will be to use docker run -d -p 3456:3456 -p 39499:39499 maccam912/tahoe-node / and the new script will leave it hanging and the container running.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.