forked from tgragnato/magnetico
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (25 loc) · 1.14 KB
/
Copy pathDockerfile
File metadata and controls
26 lines (25 loc) · 1.14 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
FROM golang:alpine3.20 AS builder
ENV CGO_ENABLED=1
ENV CGO_CFLAGS=-D_LARGEFILE64_SOURCE
WORKDIR /workspace
COPY go.mod .
COPY go.sum .
COPY . .
RUN apk add --no-cache alpine-sdk libsodium-dev zeromq-dev czmq-dev && go mod download && go build --tags fts5 . && go build --tags fts5 .
FROM alpine:3.20
WORKDIR /tmp
COPY --from=builder /workspace/magnetico /usr/bin/
RUN apk add --no-cache libstdc++ libgcc libsodium libzmq czmq \
&& echo '#!/bin/sh' >> /usr/bin/magneticod \
&& echo '/usr/bin/magnetico "$@" --daemon' >> /usr/bin/magneticod \
&& chmod +x /usr/bin/magneticod \
&& echo '#!/bin/sh' >> /usr/bin/magneticow \
&& echo '/usr/bin/magnetico "$@" --web' >> /usr/bin/magneticow \
&& chmod +x /usr/bin/magneticow
ENTRYPOINT ["/usr/bin/magnetico"]
LABEL org.opencontainers.image.title="magnetico"
LABEL org.opencontainers.image.description="Autonomous (self-hosted) BitTorrent DHT search engine"
LABEL org.opencontainers.image.url="https://tgragnato.it/magnetico/"
LABEL org.opencontainers.image.source="https://github.com/tgragnato/magnetico"
LABEL org.opencontainers.image.licenses="AGPL-3.0"
LABEL io.containers.autoupdate=registry