-
Notifications
You must be signed in to change notification settings - Fork 155
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
Docker: Use hostname instead of IP addresses #453
Comments
Would you mind explaining some of the long story please? I'm curious about
it.
…On Fri, Mar 22, 2024, 8:35 AM Richard Körber ***@***.***> wrote:
Is it possible to use hostnames as parameters, instead of IP addresses?
Currently, the docker-compose file uses a subnet and fixed IP addresses. I
cannot set up a docker network in my integration tests though (long story),
so I have to do ugly workarounds.
With hostnames instead of IPs, this would be possible (if I'm not
mistaken):
version: "3"
services:
pebble:
image: ghcr.io/letsencrypt/pebble:latest
command: -config test/config/pebble-config.json -strict -dnsserver challtestsrv:8053
ports:
- 14000:14000
- 15000:15000
challtestsrv:
image: ghcr.io/letsencrypt/pebble-challtestsrv:latest
command: -defaultIPv6 "" -defaultIPv4 challtestsrv
ports:
- 8055:8055
—
Reply to this email directly, view it on GitHub
<#453>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASFVZKPPYTDZUVK2IPDGP3YZQQSPAVCNFSM6AAAAABFDH4DEOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYDEMZZHEYDKOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
OK, let's make a short story long. 😉 I'm running integration tests in Java, and I'm starting the docker containers from the build script. I have used a construct like this, where <arg>sh</arg>
<arg>-c</arg>
<arg>pebble -strict -dnsserver $(getent hosts challtestsrv|cut -d' ' -f1):8053 -config /test/config/pebble-config.json</arg> Unfortunately it won't work anymore, because the new pebble and challtestsrv images are based on the scratch image, so there are no commands like Then I tried to set up a network with fixed IP addresses, like in Pebble's docker-compose.yml. But the docker extension of my build tool is unable to set up networks, neither in the build script nor by using docker compose. I would have to set up the network manually before running the integration tests. My current solution is to build fresh docker images based on alpine, and "steal" the relevant application files from the new pebble and challtestsrv docker images. Now I can do my In my example above, it would be unnecessary to set up a subnet with fixed IP addresses, and I also wouldn't need the |
We should be able to support hostnames instead of hardcoded IPs, and I think that makes sense to do. I'll take a bit of a run at it. |
Duplicate of #418? |
There is PR with the fix: letsencrypt/challtestsrv#20 |
Thanks @mitar, I didn't notice that PR (sorry, I wasn't watching the challtestsrv github repo). Yes, I do think that's a duplicate, and we can use your work there. |
On Pebble's side, the I'm closing it as duplicate. Thank you! |
Is it possible to use hostnames as parameters, instead of IP addresses?
Currently, the docker-compose file uses a subnet and fixed IP addresses. I cannot set up a docker network in my integration tests though (long story), so I have to do ugly workarounds.
With hostnames instead of IPs, this would be possible (if I'm not mistaken):
The text was updated successfully, but these errors were encountered: