vechain / thor

A general purpose blockchain highly compatible with Ethereum's ecosystem
GNU Lesser General Public License v3.0
799 stars 246 forks source link

vechain docker can not startup by other account except root #94

Closed lcgogo closed 6 years ago

lcgogo commented 6 years ago

Hi there,

Please notice that this is an issue tracker reserved for bug reports and feature requests.

For general questions please use the gitter channel.

OS Version:

ubuntu 16

Commit hash : (if develop)

I want to run vechain docker by nobody account but failed.

root@coin-node1:/data/group1# ls -l | grep vet drwxr-xr-x 3 nobody nogroup 4096 Aug 15 13:53 vet

docker run -d --restart always --user nobody:nogroup --cpus=".5" --device-read-bps /dev/vdb:20MB --device-write-bps /dev/vdb:20MB \ -v /data/group1/vet:/data/vet \ -p 172.16.254.1:62018:8669 \ --name vechain-1.0.1 vechain/thor:v1.0.1 --network main --api-addr 0.0.0.0:8669 --data-dir /data/vet

Expected behavior

docker runs ok

Actual behavior

root@coin-node1:/data/group1/vet# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 077acd92a252 vechain/thor:v1.0.1 "thor --network main…" 10 seconds ago Restarting (1) 2 seconds ago vechain-1.0.1

root@coin-node1:/data/group1/vet# docker logs -f --tail 20 vechain-1.0.1 Fatal: create config dir [/.org.vechain.thor]: mkdir /.org.vechain.thor: permission denied Fatal: create config dir [/.org.vechain.thor]: mkdir /.org.vechain.thor: permission denied

Steps to reproduce the behavior

mkdir -p /data/group1/vet chown -R nobody:nogroup /data/group1/vet docker run -d --restart always --user nobody:nogroup --cpus=".5" --device-read-bps /dev/vdb:20MB --device-write-bps /dev/vdb:20MB \ -v /data/group1/vet:/data/vet \ -p 172.16.254.1:62018:8669 \ --name vechain-1.0.1 vechain/thor:v1.0.1 --network main --api-addr 0.0.0.0:8669 --data-dir /data/vet

lcgogo commented 6 years ago

I remove "--user nobody:nogroup" and docker runs by root is ok.

libotony commented 6 years ago

The user you want to use must have write access to the data dir.

lcgogo commented 6 years ago

I have set the owner to nobody:nogroup chown -R nobody:nogroup /data/group1/vet

libotony commented 6 years ago

You need to add --config-dir /data/vet at the end of your startup command