pool/Dockerfile

36 lines
955 B
Text
Raw Normal View History

2022-08-03 19:26:01 +02:00
FROM --platform=${BUILDPLATFORM} golang:1.18.5-alpine as builder
2020-08-10 10:24:38 +02:00
# Copy in the local repository to build from.
2020-09-09 17:45:32 -07:00
COPY . /go/src/github.com/lightninglabs/pool
2020-08-10 10:24:38 +02:00
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo
# Explicitly turn on the use of modules (until this becomes the default).
ENV GO111MODULE on
2020-09-09 17:45:32 -07:00
# Install dependencies and install/build pool.
2020-08-10 10:24:38 +02:00
RUN apk add --no-cache --update alpine-sdk \
git \
make \
2020-09-09 17:45:32 -07:00
&& cd /go/src/github.com/lightninglabs/pool \
2020-08-10 10:24:38 +02:00
&& make install
# Start a new, final image to reduce size.
FROM --platform=${BUILDPLATFORM} alpine as final
2020-08-10 10:24:38 +02:00
2020-09-09 17:45:32 -07:00
# Expose poold ports (gRPC and REST).
2020-08-10 10:24:38 +02:00
EXPOSE 12010 8281
# Copy the binaries from the builder image.
2020-09-09 17:45:32 -07:00
COPY --from=builder /go/bin/pool /bin/
COPY --from=builder /go/bin/poold /bin/
2020-08-10 10:24:38 +02:00
# Add bash.
RUN apk add --no-cache \
bash \
ca-certificates
2020-09-09 17:45:32 -07:00
ENTRYPOINT ["poold"]