lnd/dev.Dockerfile

48 lines
1.4 KiB
Text
Raw Permalink Normal View History

# If you change this please also update GO_VERSION in Makefile (then run
# `make lint` to see where else it needs to be updated as well).
2026-06-04 09:47:05 -03:00
FROM golang:1.26.4-alpine AS builder
LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"
# 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
# Install dependencies.
RUN apk add --no-cache --update alpine-sdk \
bash \
2018-05-01 23:55:40 -04:00
git \
make
# Copy in the local repository to build from.
COPY . /go/src/github.com/lightningnetwork/lnd
# Install/build lnd.
# Note: When using `docker build`, setting the environmental variable
# `DOCKER_BUILDKIT=1` is required to enable
# [BuildKit](https://docs.docker.com/build/buildkit)
# so that the cache mounts can be used.
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
cd /go/src/github.com/lightningnetwork/lnd \
&& make \
&& make install-all tags="signrpc walletrpc chainrpc invoicesrpc peersrpc kvdb_sqlite"
2018-05-01 23:55:40 -04:00
# Start a new, final image to reduce size.
FROM alpine AS final
2018-05-01 23:55:40 -04:00
# Expose lnd ports (server, rpc).
EXPOSE 9735 10009
2018-05-01 23:55:40 -04:00
# Copy the binaries and entrypoint from the builder image.
2018-05-18 23:47:44 -04:00
COPY --from=builder /go/bin/lncli /bin/
COPY --from=builder /go/bin/lnd /bin/
2018-05-01 23:55:40 -04:00
# Add bash.
RUN apk add --no-cache \
bash
2018-05-01 23:55:40 -04:00
# Copy the entrypoint script.
COPY "docker/lnd/start-lnd.sh" .
RUN chmod +x start-lnd.sh