|
| 1 | +FROM golang:1.13-alpine as builder |
| 2 | + |
| 3 | +# Copy in the local repository to build from. |
| 4 | +COPY . /go/src/github.com/lightninglabs/shushtar |
| 5 | + |
| 6 | +# Force Go to use the cgo based DNS resolver. This is required to ensure DNS |
| 7 | +# queries required to connect to linked containers succeed. |
| 8 | +ENV GODEBUG netdns=cgo |
| 9 | + |
| 10 | +# Explicitly turn on the use of modules (until this becomes the default). |
| 11 | +ENV GO111MODULE on |
| 12 | + |
| 13 | +ENV NODE_VERSION=v12.17.0 |
| 14 | + |
| 15 | +# Install dependencies and install/build shushtar. |
| 16 | +RUN apk add --no-cache --update alpine-sdk \ |
| 17 | + git \ |
| 18 | + make \ |
| 19 | + curl \ |
| 20 | + bash \ |
| 21 | + binutils \ |
| 22 | + tar \ |
| 23 | +&& touch ~/.bashrc \ |
| 24 | +&& curl -sfSLO https://unofficial-builds.nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64-musl.tar.xz \ |
| 25 | +&& tar -xf node-${NODE_VERSION}-linux-x64-musl.tar.xz -C /usr --strip 1 \ |
| 26 | +&& rm node-${NODE_VERSION}-linux-x64-musl.tar.xz \ |
| 27 | +&& curl -o- -L https://yarnpkg.com/install.sh | bash \ |
| 28 | +&& /bin/bash \ |
| 29 | +&& . ~/.bashrc \ |
| 30 | +&& cd /go/src/github.com/lightninglabs/shushtar \ |
| 31 | +&& make install \ |
| 32 | +&& go install -v -trimpath github.com/lightningnetwork/lnd/cmd/lncli \ |
| 33 | +&& go install -v -trimpath github.com/lightninglabs/faraday/cmd/frcli \ |
| 34 | +&& go install -v -trimpath github.com/lightninglabs/loop/cmd/loop |
| 35 | + |
| 36 | +# Start a new, final image to reduce size. |
| 37 | +FROM alpine as final |
| 38 | + |
| 39 | +# Define a root volume for data persistence. |
| 40 | +VOLUME /root/.lnd |
| 41 | + |
| 42 | +# Expose shushtar and lnd ports (server, rpc). |
| 43 | +EXPOSE 8443 10009 9735 |
| 44 | + |
| 45 | +# Copy the binaries and entrypoint from the builder image. |
| 46 | +COPY --from=builder /go/bin/shushtar /bin/ |
| 47 | +COPY --from=builder /go/bin/lncli /bin/ |
| 48 | +COPY --from=builder /go/bin/frcli /bin/ |
| 49 | +COPY --from=builder /go/bin/loop /bin/ |
| 50 | + |
| 51 | +# Add bash. |
| 52 | +RUN apk add --no-cache \ |
| 53 | + bash \ |
| 54 | + jq \ |
| 55 | + ca-certificates |
| 56 | + |
| 57 | +# Specify the start command and entrypoint as the shushtar daemon. |
| 58 | +ENTRYPOINT ["shushtar"] |
0 commit comments