filosottile-mkcert
SUCCESS
10m 54s
History Source
SummaryIterations1Transcript9Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile389 bytes written
text21 lines · 389 chars
# Build mkcert from source using Go
FROM golang:tip-alpine3.23

# Install CA certificates to allow TLS during builds and runtime
RUN apk add --no-cache 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 project
RUN go build -o mkcert ./...

# Run mkcert by default
ENTRYPOINT ["./mkcert"]
WRITEWriteFile· step #2
0s
.dockerignore353 bytes written
dockerignore31 lines · 353 chars
# Ignore VCS and common dev artifacts
.git
.gitignore
.DS_Store
node_modules/
vendor/

# Go build cache and modules
vendor/
-*/.cache/

# Ignore temporary and build artifacts
*.log
*.tmp
*.bak
*.swp

# Certificates and keys (not needed in build context)
**/*.pem
**/*.crt
**/*.key
**/*.p12
**/*.p7s

# Other common ignores
_dist/
build/
dist/
Out/
out/
VERIFYVerifyBuild· step #3
1m 31s
VerifyBuildsmoke_failed
Concerns: FROM uses a moving tag golang:tip-alpine3.23 which can cause reproducibility issues., No explicit tests in the Dockerfile; consider pinning the Go version or adding a dedicated build/test step.
Smoke [FAIL]: docker run --rm --entrypoint "" <image> sh -c "set -e; cd /src; ./mkcert localhost; [ -f localhost.pem ] && [ -f localhost-key.pem ] && echo OK
  Output: sh: syntax error: unterminated quoted string

Smoke [FAIL]: docker run --rm --entrypoint "" <image> sh -c "set -e; cd /src; ./mkcert example.test; [ -f example.test.pem ] && [ -f example.test-key.pem ] && echo OK
  Output: sh: syntax error: unterminated quoted string
WRITEWriteFile· step #4
0s
Dockerfile390 chars
text21 lines · 390 chars
# Build mkcert from source using Go
FROM golang:1.18-alpine3.23

# Install CA certificates to allow TLS during builds and runtime
RUN apk add --no-cache 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 project
RUN go build -o mkcert ./...

# Run mkcert by default
ENTRYPOINT ["./mkcert"]
WRITEWriteFile· step #5
0s
Dockerfile501 bytes written
text24 lines · 501 chars
# Build mkcert from source using Go
FROM golang:tip-alpine3.23

# Install CA certificates to allow TLS during builds and runtime
RUN apk add --no-cache ca-certificates

# Build a static Go binary to be Alpine-friendly
ENV CGO_ENABLED=0

WORKDIR /src

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

# Copy the rest of the source
COPY . .

# Build the project
RUN go build -o mkcert ./...

# Run mkcert by default (overridable by docker run --entrypoint)
ENTRYPOINT ["/src/mkcert"]
VERIFYVerifyBuild· step #6
2m 41s
VerifyBuildsmoke_failed
Smoke [FAIL]: set -e; mkdir -p /src/work /src/ca; cd /src/work; mkcert -CAROOT /src/ca localhost 127.0.0.1; if [ -f /src/ca/rootCA.pem ] && ( [ -f localhost.pem ] || [ -f localhost+127.0.0.1.pem ] ); then echo PASS; else echo FAIL; exit 1; fi
  Output: sh: mkcert: not found
WRITEWriteFile· step #7
0s
Dockerfile555 chars
text24 lines · 555 chars
# Build mkcert from source using Go
FROM golang:1.18-alpine3.18

# Install CA certificates to allow TLS during builds and runtime
RUN apk add --no-cache ca-certificates

# Build a static Go binary to be Alpine-friendly
ENV CGO_ENABLED=0

WORKDIR /src

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

# Copy the rest of the source
COPY . .

# Build the project and install the binary into /usr/local/bin
RUN go build -o /usr/local/bin/mkcert ./...

# Run mkcert by default (overridable by docker run --entrypoint)
ENTRYPOINT ["mkcert"]
WRITEWriteFile· step #8
0s
Dockerfile569 bytes written
text24 lines · 569 chars
# Build mkcert from source using Go
FROM golang:tip-alpine3.23

# Install CA certificates to allow TLS during builds and runtime
RUN apk add --no-cache ca-certificates

# Build a static Go binary to be Alpine-friendly
ENV CGO_ENABLED=0

WORKDIR /src

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

# Copy the rest of the source
COPY . .

# Build the project and install the binary into /usr/local/bin
RUN go build -o /usr/local/bin/mkcert ./...

# Run mkcert by default (overridable by docker run --entrypoint)
ENTRYPOINT ["/usr/local/bin/mkcert"]
VERIFYVerifyBuild· step #9
3m 38s
VerifyBuildaccepted
Concerns: The FROM uses golang:tip-alpine3.23 (tip tag) which can yield non-deterministic builds; pin to a specific Go image version for reproducibility., No HEALTHCHECK or built-in tests in the Dockerfile (not required for approval, but adding smoke tests or a test script would be beneficial).
Smoke [PASS]: cd /tmp; /usr/local/bin/mkcert -CAROOT /tmp/mkc test.local; if [ -f /tmp/mkc/rootCA.pem ] && [ -f /tmp/test.local.pem ] && [ -f /tmp/test.local-key.pem ]; then echo OK; else echo FAIL; fi
Smoke [PASS]: cd /tmp; /usr/local/bin/mkcert -CAROOT /tmp/mkc another.local; grep -q 'BEGIN CERTIFICATE' /tmp/another.local.pem && echo PEM_OK || echo PEM_FAIL