'accessing nginx endpoint during a multi-stage docker build
I'm trying to crawl a static html site via HTTP as part of building a docker image. When I try to curl http://localhost I get connection refused. When I remove the curl statement and run the container the static content is available at localhost as expected (including running curl inside the container).
Is there any way to access an nginx endpoint during a build?
FROM ubuntu AS indexer
RUN apt-get update && apt-get install -y nginx
RUN apt-get update && apt-get install -y curl
COPY --from=builder /workdir/build /usr/share/nginx/html
RUN service nginx start
RUN curl http://localhost > /tmp/index.html
I've tried waiting for port 80 to be available before I run curl but it makes no difference.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
