NebulousLabs / docker-sia

The official docker image for the Sia daemon
https://sia.tech
MIT License
20 stars 1 forks source link

Image doesn't allow environment variables to be passed #40

Closed virtualmotion closed 3 years ago

virtualmotion commented 3 years ago

The image won't allow environment variables to be passed in. Features dependent on being able to work with environment variables, such as auto wallet unlock, don't work.

ro-tex commented 3 years ago

Hi there, @virtualmotion !

Which image, specifically, are you having trouble with? Can you share the exact command you're using to run it?

I tried the following:

inovakov ~ % docker run -d -e SIA_DATA_DIR=/new-sia-data-dir -e SIAD_DATA_DIR=/new-siad-data-dir -e SIA_API_PASSWORD=lalala -e SIA_WALLET_PASSWORD=MyWalPass nebulouslabs/sia:latest
784c85a4f652b69543a19435594a762e78c295ce28f10578cb558301198d674f
inovakov ~ % docker exec 784 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=784c85a4f652
SIA_DATA_DIR=/new-sia-data-dir
SIAD_DATA_DIR=/new-siad-data-dir
SIA_API_PASSWORD=lalala
SIA_WALLET_PASSWORD=MyWalPass
SIA_MODULES=gctwhr
HOME=/root

As you can see from the output, the extra environment variables were correctly registered in the container's environment. I also ran a custom image with a modified run.sh that prints the environment right before launching siad and that had similar output.

virtualmotion commented 3 years ago

Thank you @ro-tex . Upon digging deeper, I had used a password generator for my wallet password -- which had included the symbol '$'. It seems environment variables either don't like that very much or docker doesn't like it. After revising the password to not have a dollar sign, it seems to work.