Closed Toomblr closed 3 years ago
I add user: 1000:1000
(or whatever your UID and GID are) to my docker compose.
@robflate Like this: ` cloudcmd: image: coderaiser/cloudcmd container_name: cloudcmd environment:
Cause that doesn't work for me. Could be my own fault.
This is a cutdown version of my compose;
cloudcmd:
container_name: cloudcmd
image: coderaiser/cloudcmd:latest
restart: unless-stopped
volumes:
- /path/to/cloudcmd:/root
- /path/to/root:/mnt/fs
environment:
CLOUDCMD_ROOT: /mnt/fs
user: 1000:1000
I create and CHOWN (1000:1000) the config folder /path/to/cloudcmd
before running for the first time.
@robflate
I did it like this, according to your compose example:
cloudcmd:
image: coderaiser/cloudcmd
container_name: cloudcmd
environment:
- DOCKER_USER= myusername
- CLOUDCMD_AUTH=false
- CLOUDCMD_USERNAME=$CLOUDCMD_USERNAME
- CLOUDCMD_PASSWORD=$CLOUDCMD_PASSWORD
- user:1000:1000
security_opt:
- no-new-privileges:true
volumes:
- ~:/root
- /vol0:/vol0
- /:/mnt/fs
networks:
t2_proxy:
ipv4_address: 192.168.90.26
Sadly, this doesn't make a difference
Check my compose again and how it’s formatted. user: 1000:1000
is not an env var like you’ve got, it should be on the same indent level as environment:
. It shouldn’t start with -
either.
Thanks @robflate ! That indeed fixed it. You have my gratitude.
It would be nice to run container as user. Because all new files/folders are now created as root. Aside from the security concerns this brings along.