# Stage 1: Build esbuild from source FROM golang:tip-alpine3.23 AS builder # Install build tools RUN apk add --no-cache make bash curl WORKDIR /src # Copy Go module files first for better caching COPY go.mod go.sum ./ RUN go mod download # Copy the rest of the source COPY . . # Build esbuild from source (CGO_ENABLED=0 is set in the Makefile) RUN make esbuild # Stage 2: Minimal runtime image FROM alpine:3.23 # Ensure TLS certs are available (for any network access the binary might need) RUN apk add --no-cache ca-certificates # Create a non-root user to run the binary safely RUN adduser -D esbuild # Copy the built binary from the builder stage COPY --from=builder /src/esbuild /usr/local/bin/esbuild # Set permissions and user RUN chown esbuild:esbuild /usr/local/bin/esbuild USER esbuild WORKDIR /home/esbuild # Default command: show help, but allow overrides on container run ENTRYPOINT ["/usr/local/bin/esbuild"] CMD ["--help"]
git node_modules vendor .tmp .eslintrc.js .DS_Store *.log *.tmp build dist *.out *.exe *.dll *.zip *.tar.gz *.tar *.tgz *.rg *.png *.jpg *.jpeg *.svg *.wasm .esbuild
Summary: - Failing step/command: RUN make esbuild (builder stage 7/7) - Exact error messages and exit code: - node scripts/esbuild.js --update-version-go - make: node: No such file or directory - make: *** [Makefile:317: version-go] Error 127 - ERROR: process "/bin/sh -c make esbuild" did not complete successfully: exit code: 2 - Missing packages/files mentioned: - Node.js binary is missing (node: No such file or directory), causing the esbuild script to fail. - Version mismatch information: - No explicit version mismatch reported. Base images shown include Alpine 3.23 and golang:tip-alpine3.23, but Node is not installed in the builder image.
# Stage 1: Build esbuild from source FROM golang:tip-alpine3.23 AS builder # Install build tools RUN apk add --no-cache make bash curl nodejs npm WORKDIR /src # Copy Go module files first for better caching COPY go.mod go.sum ./ RUN go mod download # Copy the rest of the source COPY . . # Build esbuild from source (CGO_ENABLED=0 is set in the Makefile) RUN make esbuild # Stage 2: Minimal runtime image FROM alpine:3.23 # Ensure TLS certs are available (for any network access the binary might need) RUN apk add --no-cache ca-certificates # Create a non-root user to run the binary safely RUN adduser -D esbuild # Copy the built binary from the builder stage COPY --from=builder /src/esbuild /usr/local/bin/esbuild # Set permissions and user RUN chown esbuild:esbuild /usr/local/bin/esbuild USER esbuild WORKDIR /home/esbuild # Default command: show help, but allow overrides on container run ENTRYPOINT ["/usr/local/bin/esbuild"] CMD ["--help"]
Concerns: FROM golang:tip-alpine3.23 is a moving tag; pin to a specific version for reproducible builds., Final stage uses Alpine; ensure the built esbuild binary is compatible with musl if you rely on static linking. Smoke [PASS]: /usr/local/bin/esbuild --help Smoke [PASS]: command -v esbuild Smoke [PASS]: /usr/local/bin/esbuild --help | head -n 1