continuous-integration/drone/push Build is passing
- Create /var/log/network-go directory in Dockerfile for log storage - Add comprehensive logging to Docker client creation, network management, and container operations - Add logging to iptables rule management (list, delete, etc.) - Fix iptables executable path resolution in deleteMatchingLinesInContainer to use configured binary path
27 lines
566 B
Docker
27 lines
566 B
Docker
# Build stage
|
|
FROM docker.io/library/golang:1.26-alpine AS builder
|
|
|
|
WORKDIR /build
|
|
COPY network-go/go.mod network-go/go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY network-go/ .
|
|
RUN go build -o network-go -ldflags="-s -w" .
|
|
|
|
# Runtime stage
|
|
FROM docker.io/library/alpine:latest
|
|
|
|
RUN apk add --update --no-cache \
|
|
iptables \
|
|
iptables-legacy \
|
|
ca-certificates \
|
|
util-linux \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# Create log directory
|
|
RUN mkdir -p /var/log/network-go
|
|
|
|
COPY --from=builder /build/network-go /usr/local/bin/network-go
|
|
|
|
CMD ["/usr/local/bin/network-go"]
|