|
2 | 2 |
|
3 | 3 | FROM alpine:3.21@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS alpine
|
4 | 4 |
|
| 5 | +FROM --platform=$BUILDPLATFORM golang:1.24.2-alpine3.21@sha256:7772cb5322baa875edd74705556d08f0eeca7b9c4b5367754ce3f2f00041ccee AS go-builder |
| 6 | +WORKDIR /app |
| 7 | +COPY host-binary ./ |
| 8 | +RUN --mount=type=cache,target=/root/.cache/go-build <<EOT |
| 9 | + GOOS=linux CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /dist/linux/host-binary ./cmd |
| 10 | + GOOS=darwin CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /dist/darwin/host-binary ./cmd |
| 11 | + GOOS=windows CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /dist/windows/host-binary.exe ./cmd |
| 12 | +EOT |
| 13 | + |
5 | 14 | FROM --platform=$BUILDPLATFORM node:23-alpine3.21@sha256:86703151a18fcd06258e013073508c4afea8e19cd7ed451554221dd00aea83fc AS client-builder
|
6 | 15 | WORKDIR /ui
|
7 | 16 | COPY ui/package.json ui/package-lock.json ./
|
8 | 17 | RUN --mount=type=cache,target=/root/.npm npm ci
|
9 | 18 | COPY ui/. .
|
10 | 19 | RUN --mount=type=cache,target=/root/.npm npm run build
|
11 | 20 |
|
12 |
| -FROM alpine AS pull-catalog-images |
| 21 | +FROM --platform=$BUILDPLATFORM alpine AS pull-catalog-images |
13 | 22 | RUN apk add --no-cache curl yq
|
14 | 23 | COPY --from=prompts catalog.yaml /
|
15 | 24 | RUN <<EOT
|
@@ -38,8 +47,8 @@ LABEL org.opencontainers.image.title="Docker MCP Toolkit" \
|
38 | 47 | com.docker.extension.changelog="Added MCP catalog"
|
39 | 48 |
|
40 | 49 | COPY docker-compose.yaml metadata.json extension-icon.svg /
|
41 |
| -COPY host-binary/dist/windows-${TARGETARCH}/host-binary.exe /windows/host-binary.exe |
42 |
| -COPY host-binary/dist/darwin-${TARGETARCH}/host-binary /darwin/host-binary |
43 |
| -COPY host-binary/dist/linux-${TARGETARCH}/host-binary /linux/host-binary |
| 50 | +COPY --from=go-builder /dist/linux/host-binary /linux/host-binary |
| 51 | +COPY --from=go-builder /dist/darwin/host-binary /darwin/host-binary |
| 52 | +COPY --from=go-builder /dist/windows/host-binary.exe /windows/host-binary.exe |
44 | 53 | COPY --from=pull-catalog-images /icons ui/static-assets
|
45 | 54 | COPY --from=client-builder /ui/build ui
|
0 commit comments