Joe Niland
08/31/2022, 1:06 AM/usr/local/go/bin to the PATH.
I’ve tried ENV PATH="/usr/local/go/bin:$PATH" in the Dockerfile.
And appending export PATH=… in /root/.bashrc also from the Dockerfile.
The way I’m currently doing it is to add export PATH="/usr/local/go/bin:${PATH}" in a file in ~/.geodesic/overrides.d/
Is there a better way?Erik Osterman (Cloud Posse)
08/31/2022, 2:34 PMMatt Gowie
09/08/2022, 12:06 AMJeremy G (Cloud Posse)
09/08/2022, 1:33 AM/etc/profile. Add it to your repo as rootfs/etc/profileJeremy G (Cloud Posse)
09/08/2022, 1:35 AMPATH is explicitly set under Debian via /etc/profile. Every time a bash shell starts, the PATH gets reset rather than inherited. This is likely due to Debian's orientation as a more secure Linux for running servers, in that blocks a lot of attack vectors that rely on swapping out executables by rewriting PATH.
The only fix is to replace Debian's /etc/profile with one that does not change the PATH, but that could be a subtle breaking change and I am reluctant to overwrite system files like that in the base Geodesic. Among other reasons are that this will obscure and revert any future changes made by Debian and it will break the default expected (secure) behavior of Debian.
You can, of course, do it yourself. Just add the /etc/profile replacement I posted just before this to your Docker context as rootfs/etc/profile and ensure your Dockerfile has the Geodesic standard line
COPY rootfs/ /Jeremy G (Cloud Posse)
09/08/2022, 1:41 AMPATH in the Dockerfile and replace /etc/profile with something that does not reset it.Matt Gowie
09/08/2022, 2:07 AM/etc/profile looks great. That was what we were looking for. Thanks for that.
We also can use RUN to just append our PATH addition to the end of that file, which I also like so we’re not undoing Debian’s default of clearing the PATH. We’ll likely go that route.
cc @Joe NilandJoe Niland
09/08/2022, 2:25 AMJeremy G (Cloud Posse)
09/08/2022, 2:25 AMJoe Niland
09/08/2022, 2:26 AMMatt Gowie
09/08/2022, 3:15 AMJeremy G (Cloud Posse)
09/08/2022, 3:21 AMJeremy G (Cloud Posse)
09/08/2022, 3:34 AMFROM cloudposse/geodesic:pr-801-debian
LMK how it goes.Joe Niland
09/08/2022, 3:43 AMJeremy G (Cloud Posse)
09/08/2022, 7:10 PMMatt Gowie
09/08/2022, 8:23 PMJeremy G (Cloud Posse)
09/08/2022, 8:32 PMJeremy G (Cloud Posse)
09/08/2022, 8:32 PMJoe Niland
09/08/2022, 11:43 PM