Docker Desktop Windows blocks build network access. Instead of building V from source inside Docker, cross-compile Linux binary on host and COPY into minimal alpine image.
This commit is contained in:
+5
-11
@@ -1,17 +1,11 @@
|
||||
# ── Build: use official V container to compile ────────────────────────────
|
||||
FROM thevlang/vlang:alpine AS builder
|
||||
|
||||
# Copy project source and build
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
RUN git clone https://github.com/vlang/yaml.git /root/.vmodules/yaml
|
||||
RUN v -prod -o /ntfy-bridge .
|
||||
|
||||
# ── Runtime: minimal image ────────────────────────────────────────────────
|
||||
# ── Minimal Docker image for ntfy-bridge ──────────────────────────────────
|
||||
# Binary is built on the host: v -os linux -o ntfy-bridge .
|
||||
FROM alpine:3.20
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata curl
|
||||
COPY --from=builder /ntfy-bridge /usr/local/bin/ntfy-bridge
|
||||
|
||||
COPY ntfy-bridge /usr/local/bin/ntfy-bridge
|
||||
RUN chmod +x /usr/local/bin/ntfy-bridge
|
||||
|
||||
WORKDIR /etc/ntfy-bridge
|
||||
EXPOSE 9090
|
||||
|
||||
Reference in New Issue
Block a user