daml/ci/docker/daml-sdk/Dockerfile
Moritz Kiefer 3bf2402d2c
Add /etc/nsswitch.conf to our Dockerfile (#5882)
As mentioned in the comment, this is required to get DNS requests to
work. This is more important than one might realize at first:

`daml start` tries to make an HTTP request to localhost:7500 to wait
for Navigator to start up. However, in our docker image, these
requests currently fail completely since they fail to resolve
`localhost`. This stops all following steps, in particular,
`init-script` and the JSON API from starting up.

changelog_begin
changelog_end
2020-05-07 09:44:44 +02:00

15 lines
509 B
Docker

FROM openjdk:8u212-alpine
RUN apk add --no-cache curl bash
ARG VERSION
# This is needed to get the DNS requests
# from Haskell binaries to succeed.
# Otherwise they fail to even resolve localhost.
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
RUN addgroup -S daml && adduser -S daml -G daml
USER daml
RUN curl https://get.daml.com | sh -s $VERSION \
&& printf "auto-install: false\nupdate-check: never\n" >> /home/daml/.daml/daml-config.yaml
ENV PATH="/home/daml/.daml/bin:${PATH}"
WORKDIR /home/daml