lnd/docker/ltcd/Dockerfile
Olaoluwa Osuntokun 65a5eeb24e
build: make Go 1.18 the min version, update to Go 1.19
As usual, we keep with the last two Go versions, which means the last
year of Go release (they release every 6 months or so).

This change means we can now use the type params (generics) in the
project!
2022-08-23 10:54:13 -05:00

49 lines
1.5 KiB
Docker

FROM golang:1.19-alpine as builder
LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"
# Grab and install the latest version of roasbeef's fork of ltcd and all
# related dependencies.
WORKDIR $GOPATH/src/github.com/ltcsuite/ltcd
RUN apk add --no-cache --update alpine-sdk git
RUN git clone https://github.com/ltcsuite/ltcd ./
RUN go install -v . ./cmd/...
RUN go install . ./cmd/ltcctl ./cmd/gencerts
# Start a new image
FROM alpine as final
# Expose mainnet ports (server, rpc)
EXPOSE 9333 9334
# Expose testnet ports (server, rpc)
EXPOSE 19334 19335
# Expose simnet ports (server, rpc)
EXPOSE 18555 18556
# Copy the compiled binaries from the builder image.
COPY --from=builder /go/bin/ltcctl /bin/
COPY --from=builder /go/bin/ltcd /bin/
COPY --from=builder /go/bin/gencerts /bin/
COPY "start-ltcctl.sh" .
COPY "start-ltcd.sh" .
RUN apk add --no-cache \
bash \
ca-certificates \
&& chmod +x start-ltcctl.sh \
&& chmod +x start-ltcd.sh \
&& mkdir "/rpc" "/root/.ltcd" "/root/.ltcctl" \
&& touch "/root/.ltcd/ltcd.conf" \
# "ltcctl" and "lnd" to "ltcd" over docker links.
&& "/bin/gencerts" --host="*" --directory="/rpc" --force
# Create a volume to house pregenerated RPC credentials. This will be
# shared with any lnd, btcctl containers so they can securely query ltcd's RPC
# server.
# You should NOT do this before certificate generation!
# Otherwise manually generated certificate will be overridden with shared
# mounted volume! For more info read dockerfile "VOLUME" documentation.
VOLUME ["/rpc"]