Docker and config.yaml

I am trying to figure out how running Docker with storage node and its config.yaml play together.

I would like to get rid of as many environment options in the Docker run command and rather have them in the config.yaml. I also want to move the storage data to a different location than the config.yaml.

So I wonder if I could run “docker exec -it storagenode /app/storagenode setup” with all the flags I want to set like:

  • Bandwidth (–storage.allocated-bandwidth memory.Size)
  • Space --storage.allocated-disk-space memory.Size
  • Email, Wallet, etc. etc.
  • Storage location

and then simply don’t set them in the Docker run command as these settings seem to override the config.yaml settings.

Would that do?

What issues are you currently facing in current setup ?

It is just for simplification. It is easier set up a config file once and issue a simple run command rather than having a simple convig file and having to issue a complex run command any time you restart this thing.

You can use a batch file on Windows and bash script on Linux to simplify executing the docker run command.

Production would be docker-less so this would be unnecessary overhead for you. Also its more than likely to mess with your node trying to fix something that is not broken.

2 Likes

Yes I know. But the question was about using the config.yaml file.

I wouldn’t go that route. The docker image is built to be used with environment variables and assumes they are there. I think the entrypoint script assumes they exist as well, so you’ll likely run into more trouble than it’s worth. Especially since you can just save your run command in a bash script.

But if you want to know for sure, it’s open source code. Check out the github to see what you would need to change in order to make it work.

If you do that, then the sanest way is to simply extract the storagenode binary from Docker (or compile your own) and run it standalone.

You can then run “storagenode config --config-dir /where/ever/storj/config --edit-conf” to edit th thing (it’s quite well commented), “storagenode run …” to run your node, and “… dashboard …” for a simple textual dashboard. All rather simple.

1 Like

I am doing that on my first node. The run command is so nice and simple: /usr/local/bin/storj/storagenode run --config-dir /usr/local/etc/storj

However the secondnode was built with Docker, so that’s why I am asking.

Ah. Then my follow-up question should have been why you’re using docker in the first place. :stuck_out_tongue:

1 Like

:grin:
To try it and it sounded like updating is fully automated.

Ok so the first attempts have not been successful. It seems to be trickier than I thought due to the own Docker filesystem that lives in the container and to map the to the host filesystem.
Namely having a storage folder separated from the config folder did not work but would be the way to have a setup that separate apps from configs from data.

Why does the config.yaml contain a statement ‘storage.allocated-disk-space: 1.0 TB’ when the disk size in docker is 4.6TB and is correct in dashboard.sh?

Parameters given in docker run command take precedence over config.yaml parameters. Whatever you don’t specify in docker run is picked up from config.yaml.

6 Likes