krallin / tini

A tiny but valid `init` for containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forward env vars

haf opened this issue · comments

Hi,

If I have a dockerfile like this, the PYTHONPATH env var isn't forwarded to the python child.

ENV PYTHONPATH="/app/interesting:${PYTHONPATH}"
# fails
ENTRYPOINT ["tini", "--"]
# works
ENTRYPOINT ["/bin/bash", "-c"]

(Actually, https://hub.docker.com/layers/prefecthq/prefect/0.15.6-python3.8/images/sha256-2313c668f86766e34141caf27d91cd26fcd48ec3e4b41a0ce1f2006b03fab86c?context=explore — the entrypoint here doesn't forward, but I don't know if it's tini or the entrypoint.sh and I haven't had this problem with shell scripts)

I can't reproduce: 😬

$ cat Dockerfile
FROM prefecthq/prefect:0.15.6-python3.8
ENV PYTHONPATH /something/super/awesome:$PYTHONPATH

$ docker build . --pull
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM prefecthq/prefect:0.15.6-python3.8
0.15.6-python3.8: Pulling from prefecthq/prefect
f8416d8bac72: Already exists 
3d1fe1074eae: Pull complete 
01ee43ff2a96: Pull complete 
83c2515dd8ac: Pull complete 
84e681791894: Pull complete 
9d3d96975fae: Pull complete 
19731a325d6c: Pull complete 
Digest: sha256:2313c668f86766e34141caf27d91cd26fcd48ec3e4b41a0ce1f2006b03fab86c
Status: Downloaded newer image for prefecthq/prefect:0.15.6-python3.8
 ---> 50e39b83641e
Step 2/2 : ENV PYTHONPATH /something/super/awesome:$PYTHONPATH
 ---> Running in e8e9f2c28014
Removing intermediate container e8e9f2c28014
 ---> 5ccf88dbbbbb
Successfully built 5ccf88dbbbbb

$ docker run -it --rm 5ccf88dbbbbb bash
root@5bb74975b801:/# echo "$PYTHONPATH"
/something/super/awesome:

Ah, so it's more complex. When I turned off tini it started working, but I can't see where it went wrong, so I'm closing this for now.

I meet same problem. after open tini, ENV seems no work,after I close tini, ENV can work....
my tini version is: 0.19.0