-
Notifications
You must be signed in to change notification settings - Fork 386
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
add a HOSTS command to add entries to /etc/hosts #1168
Comments
Another question is whether the updated hosts should persist within the resulting image or not. Precendents in Docker: docker build --add-host option and also docker run --add-host option. |
I would love to see this feature too. During my integration tests, I'm trying to use |
Would love to see this too. This will solve the problems in my use case. Thanks! |
I need something like this to support integration tests using HBase. HBase servers register their hostnames to ZooKeeper, and clients connect to ZooKeeper to look up an HBase server. Therefore, the hostname that HBase registers to ZooKeeper must be addressable by the client, which gets complicated when HBase is running in a container and the client isn't. The easiest workaround I've found for this is to add a loopback entry for HBase to I would prefer to bake the |
Here's a more concrete example of the work-around:
Note that each ( we currently use this work-around in our own earthly-in-earthly tests: https://github.com/earthly/earthly/blob/main/tests/git-webserver/Earthfile#L85-L90 ) |
It's not trivial to modify
/etc/hosts
; it's currently set as read-only:results in:
The current workaround is to copy
/etc/hosts
elsewhere, then unmount the read-only version, then copy it back and then modify it:However, this must be done in each
RUN
command. callingearthly +pinghostsecondtime
fails as the/etc/hosts
file change does not persist.furthermore, this work around requires priviledged permissions.
This proposal is to see if we can somehow maintain a working list of hosts that will persist between RUNs. It might however require that we run earthly with
-P
.This idea came up in:
Originally posted by @dchw in #1154 (comment)
The text was updated successfully, but these errors were encountered: