-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Error] Not able to change hostname in init_hooks #1164
Comments
I think this is partially a typo/error in the I think command substitution here is misplaced,
Tested on Fedora 39 below:
It works! Sort of? For reasons that may make sense but are beyond me at the moment, the resulting hostname is a FQDN (the container name as a subdomain of the hostname). What I mean is, I would rather expect the outcome of
|
The init-hook provided for creating a distrobox with the the same hostname as its host has two typos: - Command substitution wrapping `uname -n` suppressing stdout redirect - trailing "`" Using this init-hook as suggested causes build errors. This fix corrects the suggested script by removing the command substitution and the trailing "`". See issue 89luca89#1164 for details. 89luca89#1164
In the time since making that comment I've come to thinking/realizing a few things: (1) It's probably fine that the result of this It turns out there's already been quite a lot of discussion about this in this repo and in toolbox which I only skimmed, but the important parts seem to work (e.g. ssh -x forwarding) in this scheme. (2) The documentation has a typo, which is a separate issue that I also had run into when trying this out (which is why I knew the fix). I've made a pull request to address this here. (3) OP floated the idea of having a |
In fact I ended up solving the issue using that flag. I replaced the distrobox rm env --force;
distrobox create --image docker.io/briandipalma/env:latest \
--name env \
--pull \
--additional-flags "--hostname ${HOSTNAME}" \
--pre-init-hooks "SHELL=/usr/bin/fish";
distrobox enter env; I'll close the issue as I've a solution that I'm happy with. |
The init-hook provided for creating a distrobox with the the same hostname as its host has two typos: - Command substitution wrapping `uname -n` suppressing stdout redirect - trailing "`" Using this init-hook as suggested causes build errors. This fix corrects the suggested script by echoing the command substitution and removing the trailing "`". See issue 89luca89#1164 for details.
The init-hook provided for creating a distrobox with the the same hostname as its host has two typos: - Command substitution wrapping `uname -n` suppressing stdout redirect - trailing "`" Using this init-hook as suggested causes build errors. This fix corrects the suggested script by echoing the command substitution and removing the trailing "`". See issue #1164 for details.
I have I ended up in this issue because I was looking for a way to use command substitution in This is probably the culprit, sort of. I'm not sure how I thought perhaps it's because Take the command substitution out. init_hooks="curl -sSLf get.chezmoi.io -o chezmoi-installer;"
init_hooks="chmod +x ./chezmoi-installer;"
init_hooks='./chezmoi-installer -b "/home/redbeardymcgee/devbox/.local/bin" init redbeardymcgee --ssh --apply --promptDefaults --force;'
Huh? |
Having a fake hostname causes weird failures when running Java/Hibernate code. I guess Hibernate tries to connect to a DB file using the hostname. The errors that are raised are ClassNotFound ones so it was painful to debug what was going on. Setting the hostname to my local machine one, the correct one, fixes the issue. I've been trying to add it to my init_hooks with no success so far.
Causes this
While
Causes
While
Causes
It would be nice if we could create containers that used their host's hostname as the way I imagine most people use distrobox containers is as local host like environments. I doubt people are deploying them as server host environments.
Something like
change_hostname=false
in a distrobox.ini file would be fantastic.
I see the code in
generate_command
, would a PR be accepted?The text was updated successfully, but these errors were encountered: