axiaoxin-com-investool
SUCCESS
3m 44s
History Source
SummaryIterations1Transcript3Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile611 bytes written
text32 lines · 611 chars
FROM golang:1.25.8-bookworm AS builder

WORKDIR /build

# Cache Go module downloads
COPY go.mod go.sum ./
RUN go mod download

# Copy source and build
COPY . .

# Build static binary suitable for Linux
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
RUN go build -o investool

# Runtime image
FROM alpine:3.23.3

WORKDIR /srv

# Install runtime certificates
RUN apk add --no-cache ca-certificates

# Copy built binary and config into the runtime image
COPY --from=builder /build/investool /srv/investool
COPY config.toml /srv/config.toml

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "/srv/config.toml"]
WRITEWriteFile· step #2
0s
.dockerignore107 bytes written
dockerignore14 lines · 107 chars
git
*.log
*.tmp
*.tar.gz
**/dist/**
**/vendor/**
node_modules
coverage.out
*.exe
*.dll
*.so
*.db
.DS_Store
VERIFYVerifyBuild· step #3
2m 07s
VerifyBuildaccepted
Concerns: config.toml must be present in the build context for the runtime COPY to succeed; otherwise docker build will fail, assumes the Go build produces a statically linked binary; CGO_ENABLED=0 is set, but verify the resulting binary is portable on Alpine (static is expected)
Smoke [PASS]: test -x /srv/investool
Smoke [PASS]: test -f /srv/config.toml
Smoke [PASS]: ls -l /srv | grep investool