File tree Expand file tree Collapse file tree 5 files changed +52
-35
lines changed
Expand file tree Collapse file tree 5 files changed +52
-35
lines changed Original file line number Diff line number Diff line change 1- # Multi-stage build for Pyrefly
21ARG VERSION=0.46.0
3- FROM python:3.12-slim AS builder
4- ARG VERSION
5- RUN pip install --no-cache-dir pyrefly==${VERSION}
62
7- FROM python:3.12- slim
3+ FROM ghcr.io/astral-sh/uv:python3.11-trixie- slim AS builder
84ARG VERSION
9- LABEL org.opencontainers.image.version="${VERSION}"
10- COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
5+ RUN uv tool install pyrefly==${VERSION}
6+
7+ FROM gcr.io/distroless/cc-debian12
118COPY --from=builder /usr/local/bin/pyrefly /usr/local/bin/pyrefly
129
1310WORKDIR /workspace
14- ENTRYPOINT ["pyrefly", "lsp"]
11+ ENTRYPOINT ["/usr/local/bin/ pyrefly", "lsp"]
Original file line number Diff line number Diff line change 1- # Multi-stage build for Pyright
21ARG VERSION=1.1.407
3- FROM node:22-slim AS builder
2+ FROM node:22-alpine AS builder
43ARG VERSION
5- RUN npm install -g pyright@${VERSION}
4+ WORKDIR /app
5+ RUN apk add --no-cache curl && \
6+ curl -sf https://gobinaries.com/tj/node-prune | sh && \
7+ npm install pyright@${VERSION} && \
8+ npm prune --production && \
9+ /usr/local/bin/node-prune
610
7- FROM node:22-slim
11+ FROM node:22-alpine
812ARG VERSION
913LABEL org.opencontainers.image.version="${VERSION}"
10- COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules
11- COPY --from=builder /usr/local/bin/pyright /usr/local/bin/pyright
12- COPY --from=builder /usr/local/ bin/pyright-langserver /usr/local/bin/pyright-langserver
14+ WORKDIR /app
15+ COPY --from=builder /app/node_modules ./node_modules
16+ ENV PATH="/app/node_modules/. bin:${PATH}"
1317
14- # Pyright needs node to run
1518WORKDIR /workspace
1619ENTRYPOINT ["pyright-langserver", "--stdio"]
Original file line number Diff line number Diff line change 1- # Multi-stage build for Rust -analyzer
1+ # Multi-stage build for rust -analyzer
22ARG VERSION=2025-12-15
3- FROM debian:bookworm- slim AS builder
3+ FROM rust: slim-bookworm AS builder
44ARG VERSION
5- RUN apt-get update && apt-get install -y curl && \
6- curl -L https://github.com/rust-lang/rust-analyzer/releases/download/${VERSION}/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > /usr/local/bin/rust-analyzer && \
5+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
6+
7+ # Determine architecture and download appropriate binary
8+ # rust-analyzer releases use x86_64-unknown-linux-gnu or aarch64-unknown-linux-gnu
9+ RUN set -eux; \
10+ arch=$(uname -m); \
11+ case "$arch" in \
12+ x86_64) bin="rust-analyzer-x86_64-unknown-linux-gnu.gz" ;; \
13+ aarch64) bin="rust-analyzer-aarch64-unknown-linux-gnu.gz" ;; \
14+ *) echo "Unsupported architecture: $arch"; exit 1 ;; \
15+ esac; \
16+ curl -L "https://github.com/rust-lang/rust-analyzer/releases/download/${VERSION}/${bin}" | gunzip -c - > /usr/local/bin/rust-analyzer; \
717 chmod +x /usr/local/bin/rust-analyzer
818
9- FROM debian:bookworm-slim
19+ FROM gcr.io/distroless/cc-debian12
1020ARG VERSION
1121LABEL org.opencontainers.image.version="${VERSION}"
12- RUN apt-get update && apt-get install -y libgcc-s1 && rm -rf /var/lib/apt/lists/*
22+
1323COPY --from=builder /usr/local/bin/rust-analyzer /usr/local/bin/rust-analyzer
1424
1525WORKDIR /workspace
16- ENTRYPOINT ["rust-analyzer"]
26+ ENTRYPOINT ["/usr/local/bin/rust-analyzer"]
27+
Original file line number Diff line number Diff line change 11# ty has built-in LSP
2- ARG VERSION=0.0.5
3- FROM ghcr.io/astral-sh/ty:${VERSION}
2+ ARG VERSION=latest
3+ FROM ghcr.io/astral-sh/uv:python3.11-trixie-slim AS builder
44ARG VERSION
5- LABEL org.opencontainers.image.version="${VERSION}"
5+ RUN uv tool install ty@${VERSION}
6+
7+ FROM gcr.io/distroless/cc-debian12
8+ COPY --from=builder /usr/local/bin/ty /usr/local/bin/ty
69
710WORKDIR /workspace
8- ENTRYPOINT ["ty", "server"]
11+ ENTRYPOINT ["/usr/local/bin/ ty", "server"]
Original file line number Diff line number Diff line change 1- # Multi-stage build for TypeScript Language Server
21ARG VERSION=5.1.3
3- FROM node:22-slim AS builder
2+ FROM node:22-alpine AS builder
43ARG VERSION
5- RUN npm install -g typescript-language-server@${VERSION} typescript
4+ WORKDIR /app
5+ RUN apk add --no-cache curl && \
6+ curl -sf https://gobinaries.com/tj/node-prune | sh && \
7+ npm install typescript-language-server@${VERSION} typescript && \
8+ npm prune --production && \
9+ /usr/local/bin/node-prune
610
7- FROM node:22-slim
11+ FROM node:22-alpine
812ARG VERSION
913LABEL org.opencontainers.image.version="${VERSION}"
10- COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules
11- COPY --from=builder /usr/local/bin/typescript-language-server /usr/local/bin/typescript-language-server
12- COPY --from=builder /usr/local/bin/tsserver /usr/local/bin/tsserver
13- COPY --from=builder /usr/local/bin/tsc /usr/local/bin/tsc
14+ WORKDIR /app
15+ COPY --from=builder /app/node_modules ./node_modules
16+ ENV PATH="/app/node_modules/.bin:${PATH}"
1417
1518WORKDIR /workspace
1619ENTRYPOINT ["typescript-language-server", "--stdio"]
You can’t perform that action at this time.
0 commit comments