Closed joelwanner closed 3 years ago
I mentioned this in an email a while back. You need to use --build-args with docker compose build to pass the env variables in. The virtual machines do not share envs with the host.
The proper format is in the old build.sh from before the dynamic rewrite.
From Compose file reference:
If your service specifies a build option, variables defined in environment are not automatically visible during the build. Use the args sub-option of build to define build-time environment variables.
This option might be useful.
I tested it (see most recent commits), but with no success yet. Maybe a clean build of the Docker images is required? I couldn't figure out how to do this on short notice.
The
reload.sh
script in thenode
directory usesdocker-compose build
to build our WireGuard image. However, I noticed that the environment variables in the default WireGuard configurations are never substituted (this should happen innode/docker/wireguard/Dockerfile:35
).Why is this the case? Perhaps it would be easier to generate the configuration on the host machine first and then copy it into the WireGuard container.