# Build container
FROM golang:1.24 AS build
# Set working directory for the build
WORKDIR /src
# Cache module downloads
COPY go.mod go.sum ./
RUN go mod download
# Copy the full source tree
COPY . .
# Build the release using the project's Makefile
RUN make build/weron
# Extract the binary for a minimal runtime image
RUN mkdir -p /out
RUN cp out/weron /out/weron
# Runtime container
FROM debian:stable-backports
# Install certificates for TLS support
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the release binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
# Ensure executable permissions
RUN chmod +x /usr/local/bin/weron
CMD ["/usr/local/bin/weron"]
# Ignore local development files and caches .git .gitignore node_modules vendor ~=* *.log *.tmp *.swp .DS_Store build out
Build timed out after 600s
# Build container
FROM golang:1.24 AS build
# Enable module caching and statically link where possible
ENV GOPROXY=https://proxy.golang.org,direct
ENV CGO_ENABLED=0
# Set working directory for the build
WORKDIR /src
# Cache module downloads
COPY go.mod go.sum ./
RUN go mod download
# Copy the full source tree
COPY . .
# Build the release using the project's Makefile
RUN make build/weron
# Extract the binary for a minimal runtime image
RUN mkdir -p /out
RUN cp out/weron /out/weron
# Runtime container
FROM debian:stable-backports
# Install certificates for TLS support
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the release binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
# Ensure executable permissions
RUN chmod +x /usr/local/bin/weron
CMD ["/usr/local/bin/weron"]
Build timed out after 600s
# Build container
FROM golang:1.24 AS build
# Enable module caching and CGO usage for dependencies that require it
ENV GOPROXY=https://proxy.golang.org,direct
ENV CGO_ENABLED=1
# Install build dependencies (for CGO and native bindings)
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Set working directory for the build
WORKDIR /src
# Cache module downloads
COPY go.mod go.sum ./
RUN go mod download
# Copy the full source tree
COPY . .
# Build the release using the project's Makefile
RUN make build/weron
# Extract the binary for a minimal runtime image
RUN mkdir -p /out
RUN cp out/weron /out/weron
# Runtime container
FROM debian:stable-backports
# Install certificates for TLS support
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the release binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
# Ensure executable permissions
RUN chmod +x /usr/local/bin/weron
CMD ["/usr/local/bin/weron"]
Build timed out after 600s
# Build container
FROM golang:1.24 AS build
# Enable module caching and set CGO to disable for static binary where possible
ENV GOPROXY=https://proxy.golang.org,direct
ENV CGO_ENABLED=0
# Set working directory for the build
WORKDIR /src
# Cache module downloads
COPY go.mod go.sum ./
RUN go mod download
# Copy the full source tree
COPY . .
# Build the release using the project's Makefile
RUN make build/weron
# Extract the binary for a minimal runtime image
RUN mkdir -p /out
RUN cp out/weron /out/weron
# Runtime container
FROM debian:stable-backports
# Install certificates for TLS support
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the release binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
# Create a non-root user for better security
RUN groupadd -r weron \
&& useradd -r -g weron -d /home/weron -s /bin/sh weron \
&& mkdir -p /home/weron
# Ensure executable permissions
RUN chmod +x /usr/local/bin/weron
USER weron
CMD ["/usr/local/bin/weron"]
Build timed out after 600s
# Build container - two-stage build for weron
FROM golang:1.24 AS build
# Build flags: static binary to ease runtime requirements
ENV CGO_ENABLED=0 \
GOFLAGS="-mod=mod"
WORKDIR /src
# First, install and cache module dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source and build
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
make build/weron
# Extract the release binary
RUN mkdir -p /out
RUN cp out/weron /out/weron
# Runtime container
FROM debian:stable-backports
# Install runtime CA certificates (no extra runtime libraries unless needed)
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy the released binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
RUN chmod +x /usr/local/bin/weron
CMD ["weron"]
# Bake-in Docker ignore rules to speed up builds .git .gitignore node_modules vendor out build *.log *.tmp *.swp *.swo .DS_Store
# Bake-in Docker ignore rules to speed up builds .git .gitignore node_modules vendor out build *.log *.tmp *.swp *.swo .DS_Store
Build timed out after 600s
# Build container - two-stage build for weron
FROM golang:1.24 AS build
# Build flags: static binary to ease runtime requirements
ENV CGO_ENABLED=0 \
GOFLAGS="-mod=mod" \
GOPROXY=https://proxy.golang.org,direct
WORKDIR /src
# First, install and cache module dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source and build
COPY . .
# Build the release directly to /out/weron to simplify layering
RUN go build -o /out/weron ./cmd/weron
# Extract the release binary
RUN mkdir -p /out
RUN cp /out/weron /out/weron
# Runtime container
FROM debian:stable-backports
# Install runtime CA certificates (no extra runtime libraries unless needed)
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy the released binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
RUN chmod +x /usr/local/bin/weron
CMD ["weron"]
Build timed out after 600s
# Build container - two-stage build for weron
FROM golang:1.24 AS build
# Build flags: static binary to ease runtime requirements
ENV CGO_ENABLED=0 \
GOFLAGS="-mod=mod" \
GOPROXY=https://proxy.golang.org,direct
WORKDIR /src
# First, install and cache module dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source and build
COPY . .
# Build the release directly to /out/weron to simplify layering
RUN go build -o /out/weron ./cmd/weron
# Extract the release binary
RUN mkdir -p /out
# Runtime container
FROM debian:stable-backports
# Install runtime CA certificates (no extra runtime libraries unless needed)
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy the released binary from the build stage
COPY --from=build /out/weron /usr/local/bin/weron
RUN chmod +x /usr/local/bin/weron
CMD ["weron"]