axiaoxin-com-investool
FAILURE
148m 35s
History Source
SummaryIterations3Transcript30Dockerfile
01Iteration 1
WRITEWriteFile· step #1
1s
Dockerfile810 bytes written
text33 lines · 810 chars
# Multi-stage Dockerfile for Investool
# Builder stage
FROM golang:tip-alpine3.23 AS builder

WORKDIR /src

# Copy go module files first for cached dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool

# Runtime stage
FROM alpine:3.19

# Install CA certificates for HTTPS requests
RUN apk update && apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy the built binary and the config
COPY --from=builder /src/investool ./investool
COPY config.toml ./config.toml

# Expose the API/Web ports used by Investool
EXPOSE 4869 4870

ENTRYPOINT ["./investool", "-c", "./config.toml"]
WRITEWriteFile· step #2
0s
.dockerignore164 bytes written
dockerignore16 lines · 164 chars
# .dockerignore
# Ignore git and editor specific files
.git
.gitignore
*.md
*.log
.idea
.vscode
.DS_Store
vendor
node_modules
__pycache__
*.pyc
build.sh
Dockerfile
VERIFYVerifyBuild· step #3
10m 48s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #4
0s
Dockerfile811 chars
text33 lines · 811 chars
# Multi-stage Dockerfile for Investool
# Builder stage
FROM golang:1.20-alpine3.23 AS builder

WORKDIR /src

# Copy go module files first for cached dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool

# Runtime stage
FROM alpine:3.19

# Install CA certificates for HTTPS requests
RUN apk update && apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy the built binary and the config
COPY --from=builder /src/investool ./investool
COPY config.toml ./config.toml

# Expose the API/Web ports used by Investool
EXPOSE 4869 4870

ENTRYPOINT ["./investool", "-c", "./config.toml"]
WRITEWriteFile· step #5
0s
Dockerfile810 bytes written
text33 lines · 810 chars
# Multi-stage Dockerfile for Investool
# Builder stage
FROM golang:tip-alpine3.23 AS builder

WORKDIR /src

# Copy go module files first for cached dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool

# Runtime stage
FROM alpine:3.19

# Install CA certificates for HTTPS requests
RUN apk update && apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy the built binary and the config
COPY --from=builder /src/investool ./investool
COPY config.toml ./config.toml

# Expose the API/Web ports used by Investool
EXPOSE 4869 4870

ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #6
11m 01s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
DOCKERDockerImageSearch· step #7
0s
search docker hubgolang:alpine1 results
show lines1
Image golang:alpine exists on Docker Hub.
DOCKERDockerImageSearch· step #8
0s
search docker hubgolang:tip-alpine3.231 results
show lines1
Image golang:tip-alpine3.23 exists on Docker Hub.
WRITEWriteFile· step #9
0s
Dockerfile810 bytes written
text33 lines · 810 chars
# Multi-stage Dockerfile for Investool
# Builder stage
FROM golang:tip-alpine3.23 AS builder

WORKDIR /src

# Copy go module files first for cached dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool

# Runtime stage
FROM alpine:3.19

# Install CA certificates for HTTPS requests
RUN apk update && apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy the built binary and the config
COPY --from=builder /src/investool ./investool
COPY config.toml ./config.toml

# Expose the API/Web ports used by Investool
EXPOSE 4869 4870

ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #10
11m 14s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #11
0s
Dockerfile947 bytes written
text38 lines · 947 chars
# Multi-stage Dockerfile for Investool
# Builder stage
FROM golang:tip-alpine3.23 AS builder

WORKDIR /src

# Copy go module files first for cached dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool

# Runtime stage
FROM alpine:3.19

# Install CA certificates for HTTPS requests
RUN apk update && apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy the built binary and the config
COPY --from=builder /src/investool ./investool
COPY config.toml ./config.toml

# Create a non-root user for runtime
RUN adduser -D -S investool
RUN chown investool:investool ./investool ./config.toml
USER investool

# Expose the API/Web ports used by Investool
EXPOSE 4869 4870

ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #12
10m 52s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
02Iteration 2
WRITEWriteFile· step #1
0s
Dockerfile705 bytes written
text31 lines · 705 chars
FROM golang:1.20-alpine3.19 AS builder

WORKDIR /src

# Cache mod download
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source
COPY . .

# Build the binary with version injected
RUN V=$(TZ=Asia/Shanghai date +'%y%m%d%H%M') && \
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
    go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=${V}" -o investool

# Runtime image
FROM alpine:3.19

# Install CA certificates for TLS
RUN apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy binary and config
COPY --from=builder /src/investool /srv/investool/investool
COPY config.toml ./config.toml

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
WRITEWriteFile· step #2
0s
.dockerignore131 bytes written
dockerignore16 lines · 131 chars
# Ignore VCS and dependencies
.git
.gitignore
vendor/
node_modules/
dist/
*.tar.gz
*.log
*.out
*.exe
*.dll
*.so
*.dylib
.DS_Store

VERIFYVerifyBuild· step #3
11m 01s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #4
0s
Dockerfile749 bytes written
text33 lines · 749 chars
FROM golang:1.20-alpine3.19 AS builder

RUN apk add --no-cache git ca-certificates

WORKDIR /src

# Cache mod download
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the source
COPY . .

# Build the binary with version injected
RUN V=$(TZ=Asia/Shanghai date +'%y%m%d%H%M') && \
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
    go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=${V}" -o investool

# Runtime image
FROM alpine:3.19

# Install CA certificates for TLS
RUN apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy binary and config
COPY --from=builder /src/investool /srv/investool/investool
COPY config.toml ./config.toml

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #5
10m 49s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #6
0s
Dockerfile815 bytes written
text34 lines · 815 chars
FROM golang:1.20-alpine3.19 AS builder

# Ensure git is available for modules that may fetch from VCS
RUN apk add --no-cache git

WORKDIR /src

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

# Copy the rest of the source
COPY . .

# Build the binary with version injected
RUN V=$(TZ=Asia/Shanghai date +'%y%m%d%H%M') && \
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
    go build -trimpath -ldflags "-s -w -X github.com/axiaoxin-com/investool/version.Version=${V}" -o investool

# Runtime image
FROM alpine:3.19

# Install CA certificates for TLS
RUN apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy binary and config
COPY --from=builder /src/investool /srv/investool/investool
COPY config.toml ./config.toml

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #7
10m 58s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #8
0s
Dockerfile906 bytes written
text38 lines · 906 chars
FROM golang:1.20-alpine3.19 AS builder

# Speed up module downloads
ENV GOPROXY=https://goproxy.cn,direct
ENV CGO_ENABLED=0

# Ensure git is available for module fetches and CA certs for TLS
RUN apk add --no-cache git ca-certificates

WORKDIR /src

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

# Copy the rest of the source
COPY . .

# Build the binary with version injected
RUN V=$(TZ=Asia/Shanghai date +'%y%m%d%H%M') && \
    GOOS=linux GOARCH=amd64 \
    go build -trimpath -ldflags "-s -w -X github.com/axiaoxin-com/investool/version.Version=${V}" -o investool

# Runtime image
FROM alpine:3.19

# Install CA certificates for TLS
RUN apk add --no-cache ca-certificates

WORKDIR /srv/investool

# Copy binary and config
COPY --from=builder /src/investool /srv/investool/investool
COPY config.toml ./config.toml

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #9
10m 27s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
03Iteration 3
WRITEWriteFile· step #1
0s
Dockerfile759 bytes written
text32 lines · 759 chars
FROM golang:tip-alpine3.23 AS builder

WORKDIR /src

# Install build dependencies
RUN apk add --no-cache git ca-certificates

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

# Copy the source code
COPY . .

# Build the binary with version injected
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool


FROM alpine:3.23 AS runtime

# Ensure certificates are present for TLS
RUN apk --no-cache add ca-certificates

WORKDIR /srv/investool

# Copy the built binary and config
COPY --from=builder /src/investool ./investool
COPY --from=builder /src/config.toml ./config.toml

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #2
10m 35s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
VERIFYVerifyBuild· step #3
10m 53s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #4
0s
Dockerfile795 bytes written
text33 lines · 795 chars
FROM golang:1.20-alpine3.18 AS builder

WORKDIR /src

# Install build dependencies
RUN apk add --no-cache git ca-certificates

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

# Copy the source code
COPY . .

# Build the binary with version injected
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=$(TZ=Asia/Shanghai date +'%y%m%d%H%M')" -o investool


FROM alpine:3.23 AS runtime

# Ensure certificates are present for TLS
RUN apk --no-cache add ca-certificates

WORKDIR /srv/investool

# Copy files from builder
COPY --from=builder /src/investool ./investool
COPY --from=builder /src/config.toml ./config.toml
COPY --from=builder /src/statics ./statics

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #5
10m 43s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #6
0s
.dockerignore315 bytes written
dockerignore27 lines · 315 chars
# Exclude version control
.git

# OS files
.DS_Store

# Local env files
.env

# Misc directories not needed for build
misc/scripts/
misc/docs/
misc/pics/
misc/data/

# Build artifacts
dist/
*.tar.gz
*.exe

# Documentation and tests (not needed for runtime image)
README.md
CHANGELOG.md

# Docker related
Dockerfile
VERIFYVerifyBuild· step #7
10m 43s
VerifyBuildbuild_failed
Build error
Build timed out after 600s
WRITEWriteFile· step #8
0s
Dockerfile877 bytes written
text36 lines · 877 chars
FROM golang:1.20-alpine3.18 AS builder

# Speed up module download with a Go proxy
ENV GOPROXY=https://goproxy.cn,direct

WORKDIR /src

# Install build dependencies
RUN apk add --no-cache git ca-certificates

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

# Copy the source code
COPY . .

# Build the binary with version injected
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=$(TZ=Asia/Shanghai date +'%y%m%d%H%M')" -o investool


FROM alpine:3.23 AS runtime

# Ensure certificates are present for TLS
RUN apk --no-cache add ca-certificates

WORKDIR /srv/investool

# Copy files from builder
COPY --from=builder /src/investool ./investool
COPY --from=builder /src/config.toml ./config.toml
COPY --from=builder /src/statics ./statics

EXPOSE 4869 4870
ENTRYPOINT ["./investool", "-c", "./config.toml"]
VERIFYVerifyBuild· step #9
10m 39s
VerifyBuildbuild_failed
Build error
Build timed out after 600s