Closed adripo closed 1 year ago
You likely did not recreate the container, or did not set the env vars correctly.
You're providing conflicting and incomplete information.
You show us a yaml snippet for two env vars, yet you're saying you're doing docker run
.
This seems like user error but we don't have enough info to determine what type. Closing as it is not a bug. We have other channels for config help.
@aptalca Thanks for your answer. I tested a clean version and you are right, everything works as expected. After a little more digging I discovered what my problem is:
My docker-compose is something like this:
services:
transmission:
container_name: transmission
image: lscr.io/linuxserver/transmission
ports:
- "9091:9091"
- "31413:51413"
- "31413:51413/udp"
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- TRANSMISSION_WEB_HOME=/transmission-web-control
env_file:
- transmission.env
volumes:
...
and the transmission.env
file contains:
USER=admin
PASS=secret-password
Using an external env file for the USER
will not work and will always be overwritten with root
. I think this happens because the moment when the env file is loaded is different from when the environment
section in docker-compose is loaded, so it gets the default user root. Do you have any clue on that?
@aptalca I have done some more tests and I have more clues on the issue, still cannot resolve it.
The issue happens when I use two $
inside the password. The password is written in a separate file that is passed with env_file
transmission.env:
USER=admin
PASS=test12$$
Using this as password will change the username to root
. If you prefer I can contact you on discord.
I found out that the problem explained in my hidden message above persists even without using $$
inside the password
Trying to log from browser will only work with
root
as user and theUSER
configured as ENV duringdocker run
will not work. More details on my config and results inside Current BehaviorExpected Behavior
USER
USER
==USER
variable set during docker runCurrent Behavior
docker compose:
inside the container:
Steps to Reproduce
USER
ENV duringdocker run
docker exec
inside the containerenv
USER=root
and not the value set during runroot
as userEnvironment
OS:- CPU architecture: x86_64 How docker service was installed:
Command used to create docker container (run/create/compose/screenshot)
Docker logs