-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
37 lines (31 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Builder
# Note: Not using Alpine, because of CGo deps
FROM golang:1.19-buster as builder
ENV GOBIN=/usr/local/bin
ARG GOPROXY=
# GOFLAGS workaround for Go 1.19 when building from subrepos
# Issue: https://github.com/golang/go/issues/53640
ARG GOFLAGS
ENV GOFLAGS ${GOFLAGS}
RUN mkdir /src
ADD go.mod go.sum /src/
WORKDIR /src
RUN echo "GOPROXY=$GOPROXY"; go mod download
ADD . /src
RUN echo "GOFLAGS=$GOFLAGS"; go install ./cmd/...
# Dist
# Note: When using Alpine, ls prevents auth api from correctly functioning (most likely some locking issue)
FROM debian:buster-slim
RUN ulimit -n 2000 \
&& apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& apt-get -y clean \
&& rm /etc/ld.so.cache \
&& rm -rf /var/lib/apt/lists/* \
&& rm /var/log/apt/history.log \
&& rm /var/log/dpkg.log \
&& rm /var/log/apt/term.log
RUN update-ca-certificates
COPY --from=builder /usr/local/bin/lightningstream /usr/local/bin/lightningstream
RUN mkdir /snapshots && chmod 777 /snapshots
ENTRYPOINT ["/usr/local/bin/lightningstream"]