feat: txood docker image
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
parent
0fe656dd01
commit
8ec90008ed
38
txood/Dockerfile
Normal file
38
txood/Dockerfile
Normal file
@ -0,0 +1,38 @@
|
||||
# build txoo
|
||||
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
git \
|
||||
rust
|
||||
|
||||
RUN apk add cargo
|
||||
|
||||
RUN git clone --recurse-submodules https://gitlab.com/lightning-signer/txoo.git && \
|
||||
cd txoo && \
|
||||
cargo build --release -p txood
|
||||
|
||||
# txoo runner
|
||||
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
||||
|
||||
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||
maintainer.1="Dev Random (@devrandom01)"
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
build-base \
|
||||
bind-tools \
|
||||
libev-dev \
|
||||
curl-dev
|
||||
|
||||
COPY --from=builder /build/txoo/target/release/txood /usr/bin/txood
|
||||
|
||||
COPY txood/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
VOLUME ["/root/.txoo/"]
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["txood"]
|
21
txood/entrypoint.sh
Normal file
21
txood/entrypoint.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
LIGHTNING_NETWORK=""
|
||||
|
||||
case $BITCOIN_CHAIN in
|
||||
"test") LIGHTNING_NETWORK=testnet ;;
|
||||
"regtest") LIGHTNING_NETWORK=regtest ;;
|
||||
"main") LIGHTNING_NETWORK=bitcoin ;;
|
||||
"signet") LIGHTNING_NETWORK=signet ;;
|
||||
*) echo "Invalid BITCOIN_CHAIN value: $BITCOIN_CHAIN" && exit 1 ;;
|
||||
esac
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for txood"
|
||||
|
||||
set -- txood --network $LIGHTNING_NETWORK "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user