-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.53 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.53 KB
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
38
39
40
41
42
43
44
45
# Start with a Golang builder image.
FROM golang:1.24.10-alpine3.22@sha256:12c199a889439928e36df7b4c5031c18bfdad0d33cdeae5dd35b2de369b5fbf5 AS golangbuilder
# Pass a tag, branch or a commit using build-arg. This allows a docker image to
# be built from a specified Git state.
ARG checkout="master"
# Install dependencies and install/build chantools.
RUN apk add --no-cache --update alpine-sdk make \
&& git clone https://github.com/lightninglabs/chantools /go/src/github.com/lightninglabs/chantools \
&& cd /go/src/github.com/lightninglabs/chantools \
&& git checkout $checkout \
&& make install
# Start a new, final image to reduce size.
FROM alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 AS final
# Define a root volume for data persistence.
VOLUME /chantools
WORKDIR /chantools
# We'll use the default / directory as the home directory, since the /chantools
# folder will be overwritten if a volume is mounted there.
ENV HOME=/
# We'll expect the lnd data directory to be mounted here.
VOLUME /lnd
# Copy the binaries and entrypoint from the builder image.
COPY ./docker/docker-entrypoint.sh /bin/
COPY ./docker/bash-wrapper.sh /usr/local/bin/bash
COPY --from=golangbuilder /go/bin/chantools /bin/
# Make the wrapper executable.
RUN chmod 0777 /usr/local/bin/bash
# Add bash.
RUN apk add --no-cache \
bash \
jq \
ca-certificates
# We'll want to just start a shell, but also give the user some info on how to
# use this image, which we do with a shell script.
ENTRYPOINT ["/bin/docker-entrypoint.sh"]