2019-04-10 22:13:11 +03:00
|
|
|
FROM golang:1.12-alpine as builder
|
2017-05-13 23:21:57 +03:00
|
|
|
|
2019-11-20 05:06:17 +03:00
|
|
|
LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"
|
2017-05-13 23:21:57 +03:00
|
|
|
|
2018-05-19 06:48:15 +03:00
|
|
|
# Grab and install the latest version of roasbeef's fork of ltcd and all
|
|
|
|
# related dependencies.
|
|
|
|
WORKDIR $GOPATH/src/github.com/ltcsuite/ltcd
|
2019-02-10 09:51:06 +03:00
|
|
|
RUN apk add --no-cache --update alpine-sdk git
|
|
|
|
RUN git clone https://github.com/ltcsuite/ltcd ./
|
|
|
|
RUN GO111MODULE=on go install -v . ./cmd/...
|
|
|
|
RUN GO111MODULE=on go install . ./cmd/ltcctl ./cmd/gencerts
|
2018-05-19 06:48:15 +03:00
|
|
|
|
|
|
|
# Start a new image
|
|
|
|
FROM alpine as final
|
|
|
|
|
2017-05-13 23:21:57 +03:00
|
|
|
# Expose mainnet ports (server, rpc)
|
2019-11-06 12:05:06 +03:00
|
|
|
EXPOSE 9333 9334
|
2017-05-13 23:21:57 +03:00
|
|
|
|
|
|
|
# Expose testnet ports (server, rpc)
|
2019-11-06 12:05:06 +03:00
|
|
|
EXPOSE 19334 19335
|
2017-05-13 23:21:57 +03:00
|
|
|
|
|
|
|
# Expose simnet ports (server, rpc)
|
|
|
|
EXPOSE 18555 18556
|
|
|
|
|
2018-05-19 06:48:15 +03:00
|
|
|
# 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/
|
2017-05-13 23:21:57 +03:00
|
|
|
|
2018-05-19 06:48:15 +03:00
|
|
|
COPY "start-ltcctl.sh" .
|
|
|
|
COPY "start-ltcd.sh" .
|
2017-05-13 23:21:57 +03:00
|
|
|
|
2018-05-19 06:48:15 +03:00
|
|
|
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" \
|
2017-05-13 23:21:57 +03:00
|
|
|
# "ltcctl" and "lnd" to "ltcd" over docker links.
|
2018-05-19 06:48:15 +03:00
|
|
|
&& "/bin/gencerts" --host="*" --directory="/rpc" --force
|
2017-05-13 23:21:57 +03:00
|
|
|
|
|
|
|
# Create a volume to house pregenerated RPC credentials. This will be
|
2017-07-04 23:25:24 +03:00
|
|
|
# shared with any lnd, btcctl containers so they can securely query ltcd's RPC
|
2017-05-13 23:21:57 +03:00
|
|
|
# server.
|
|
|
|
# You should NOT do this before certificate generation!
|
2018-02-07 06:11:11 +03:00
|
|
|
# Otherwise manually generated certificate will be overridden with shared
|
2017-05-13 23:21:57 +03:00
|
|
|
# mounted volume! For more info read dockerfile "VOLUME" documentation.
|
|
|
|
VOLUME ["/rpc"]
|