#geodesic (2022-08)
Discussions related to https://github.com/cloudposse/geodesic
Archive: https://archive.sweetops.com/geodesic/
2022-08-01
v1.2.3 Included Tools Update AWS CLI packages @renovate (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1299518463” data-permission-text=”Title is private” data-url=”https://github.com/cloudposse/geodesic/issues/796“…
Included Tools Update AWS CLI packages @renovate (#796) This PR contains the following updates: Package Change Age Adoption Passing Confidence awscli (source, changelog) ==1.25.22 -> ==…
renovate has one repository available. Follow their code on GitHub.
This PR contains the following updates: Package Change Age Adoption Passing Confidence awscli (source, changelog) ==1.25.22 -> ==1.25.43 boto3 ==1.24.22 -> ==1.24.43 Release No…
2022-08-30
Is there a standard way to add to the PATH env var when building a custom geodesic image?
For example, I want to add /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?
@Jeremy G (Cloud Posse)
@Jeremy G (Cloud Posse) friendly ping on this.
We’re installing golang in our toolbox Containerfile and then we’d like to make sure that it is in the PATH. When we set the PATH in the Containerfile, it gets overwritten so we haven’t been able to accomplish it that way. So right now, we’re doing this by using an overrides file locally on the host machine, but that doesn’t scale with many team members.
To skip over digging deep into the internals of the Geodesic bash-fu, we figured you’d have a solution for us. Any thoughts?
Replacement for /etc/profile
. Add it to your repo as rootfs/etc/profile
Sorry I missed the first mention of this (I blame Slack).
This is not Geodesic’s doing. The issue is that PATH
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/ /
@Joe Niland No, I don’t think there is a better way than using overrides.d
; this is the kind of thing that was designed for. Unless you mean you want everyone using the image to get it, in which case I would advise you to do what I advised @Matt Gowie to do above, which is set the PATH
in the Dockerfile and replace /etc/profile
with something that does not reset it.
@Jeremy G (Cloud Posse) overriding /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 Niland
@Jeremy G (Cloud Posse) thanks very much for the clarification. I didn’t realise that was the case with Debian. Yes, the question arose because we want to make it a standard ‘feature’ of this custom Geodesic image.
@Matt Gowie @Joe Niland I’m preparing a PR that will set the PATH the way Alpine does, among other things. That is, it appends to the inherited path rather than reseting it.
Sounds great! Thank you
Awesome — Thanks Jeremy
This should do it. Please review and LMK what you think. https://github.com/cloudposse/geodesic/pull/801
what
• Copy Alpine PATH
initialization to Debian, replacing Debian behavior of clobbering preexisting PATH
• Update Debian 11.3 -> 11.4
• Update Alpine 3.15.4 -> 3.16.2
• Miscellaneous cleanups
why
• Debian behavior is to ignore any existing value of PATH
environment variable when launching bash
and set it to a predefined value. This makes it impossible to set the PATH
in the Dockerfile. Alpine’s approach (taken from Arch Linux) is to append the path components to any existing PATH
value, allowing users to set a preferred path, but still ensuring that all expected/required directories are included in PATH
to start.
• Keep up-to-date
• Clean up little things that were nevertheless irritating
references
@Joe Niland @Matt Gowie You can try it out by using
FROM cloudposse/geodesic:pr-801-debian
LMK how it goes.
Thanks @Jeremy G (Cloud Posse) will do this ASAP
@Matt Gowie Any feedback before I publish this?
Nope — It looks like it works great. Thanks for the extremely speedy turnaround — Love to see it!
Geodesic version 1.3.0 has been published. Docker image should be available in about 20 minutes.
@Erik Osterman (Cloud Posse)
Thanks again @Jeremy G (Cloud Posse) (I left brief test details in the PR comments in case anyone else is following this thread)