Context:
Issue:
For developer convenience, we run a reverse proxy server locally that dispatches requests to our various containers. Since the majority of browsers will implicitly resolve any domain name ending in .localhost to the loopback address, we are able to avoid running a local nameserver by choosing appropriate hostnames.
Within the containers, we have configured Docker to map those hostnames back to the reverse proxy. In this way, tools running within the container can process HTML markup containing those hostnames. This works fine in all our environments for the majority of our tools.
On our x86 machines, Prince will route a request for http://assets.localhost/some/image.png to the reverse proxy server, as expected.
On our ARM64 machines, Prince will route the same request to 127.0.0.1:80.
Neither behavior is strictly incorrect (according to the relevant specs, user agents may choose to optimize lookups for *.localhost), but it's definitely strange to see the behavior be inconsistent.
- On our team, we run builds of PDFs inside containers running in Docker for Mac.
- These containers run Alpine Linux 3.13, because they're coupled to our application's needs.
- Our team has hardware that is a mix of Intel and Apple silicon, so we support both x86_64 and ARM64 platforms in our containers.
- On our x86_64 machines, we install prince-15-alpine3.13-x86_64.
- On our ARM64 machines, we install prince-15-linux-generic-aarch64-musl, since there is no Alpine-specific build available.
Issue:
For developer convenience, we run a reverse proxy server locally that dispatches requests to our various containers. Since the majority of browsers will implicitly resolve any domain name ending in .localhost to the loopback address, we are able to avoid running a local nameserver by choosing appropriate hostnames.
Within the containers, we have configured Docker to map those hostnames back to the reverse proxy. In this way, tools running within the container can process HTML markup containing those hostnames. This works fine in all our environments for the majority of our tools.
On our x86 machines, Prince will route a request for http://assets.localhost/some/image.png to the reverse proxy server, as expected.
On our ARM64 machines, Prince will route the same request to 127.0.0.1:80.
Neither behavior is strictly incorrect (according to the relevant specs, user agents may choose to optimize lookups for *.localhost), but it's definitely strange to see the behavior be inconsistent.