Skip to content

Commit d05cd6a

Browse files
committed
build(container): standardize ContainerFiles and improve Podman compatibility
1 parent 74c7c51 commit d05cd6a

File tree

7 files changed

+54
-13
lines changed

7 files changed

+54
-13
lines changed

container/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Create a new directory with the server name and add a `ContainerFile`:
2727
```dockerfile
2828
# Example ContainerFile for a Node.js based LSP server
2929
ARG VERSION=1.0.0
30-
FROM node:22-slim AS builder
30+
FROM docker.io/library/node:22-slim AS builder
3131
ARG VERSION
3232
RUN npm install -g <package-name>@${VERSION}
3333

34-
FROM node:22-slim
34+
FROM docker.io/library/node:22-slim
3535
ARG VERSION
3636
LABEL org.opencontainers.image.version="${VERSION}"
3737
COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules
@@ -104,8 +104,11 @@ The CI system will automatically:
104104

105105
To manually test:
106106
```bash
107-
# Build container
107+
# Build container (works with both Docker and Podman)
108+
# Podman will automatically pick up 'ContainerFile'
108109
docker build -f container/<server-name>/ContainerFile -t lsp/<server-name>:latest .
110+
# or
111+
podman build -t lsp/<server-name>:latest container/<server-name>/
109112

110113
# Test the container
111114
docker run --rm lsp/<server-name>:latest --version

container/deno/ContainerFile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Deno has built-in LSP
22
ARG VERSION=2.6.3
3-
FROM denoland/deno:alpine-${VERSION}
3+
FROM docker.io/denoland/deno:alpine-${VERSION}
44
ARG VERSION
5-
LABEL org.opencontainers.image.version="${VERSION}"
5+
LABEL org.opencontainers.image.title="Deno LSP" \
6+
org.opencontainers.image.description="Deno Language Server" \
7+
org.opencontainers.image.version="${VERSION}" \
8+
org.opencontainers.image.source="https://github.com/wangbowei/lsp-client" \
9+
org.opencontainers.image.licenses="MIT"
610

711
WORKDIR /workspace
12+
USER deno
813
ENTRYPOINT ["deno", "lsp"]

container/pyrefly/ContainerFile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ ARG VERSION
55
RUN uv tool install pyrefly==${VERSION}
66

77
FROM gcr.io/distroless/cc-debian12
8+
ARG VERSION
9+
LABEL org.opencontainers.image.title="Pyrefly LSP" \
10+
org.opencontainers.image.description="Pyrefly Language Server" \
11+
org.opencontainers.image.version="${VERSION}" \
12+
org.opencontainers.image.source="https://github.com/wangbowei/lsp-client" \
13+
org.opencontainers.image.licenses="MIT"
14+
815
COPY --from=builder /usr/local/bin/pyrefly /usr/local/bin/pyrefly
916

1017
WORKDIR /workspace
18+
USER 65532:65532
1119
ENTRYPOINT ["/usr/local/bin/pyrefly", "lsp"]

container/pyright/ContainerFile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG VERSION=1.1.407
2-
FROM node:22-alpine AS builder
2+
FROM docker.io/library/node:22-alpine AS builder
33
ARG VERSION
44
WORKDIR /app
55
RUN apk add --no-cache curl && \
@@ -8,12 +8,18 @@ RUN apk add --no-cache curl && \
88
npm prune --production && \
99
/usr/local/bin/node-prune
1010

11-
FROM node:22-alpine
11+
FROM docker.io/library/node:22-alpine
1212
ARG VERSION
13-
LABEL org.opencontainers.image.version="${VERSION}"
13+
LABEL org.opencontainers.image.title="Pyright LSP" \
14+
org.opencontainers.image.description="Pyright Language Server" \
15+
org.opencontainers.image.version="${VERSION}" \
16+
org.opencontainers.image.source="https://github.com/wangbowei/lsp-client" \
17+
org.opencontainers.image.licenses="MIT"
18+
1419
WORKDIR /app
1520
COPY --from=builder /app/node_modules ./node_modules
1621
ENV PATH="/app/node_modules/.bin:${PATH}"
1722

1823
WORKDIR /workspace
24+
USER node
1925
ENTRYPOINT ["pyright-langserver", "--stdio"]

container/rust-analyzer/ContainerFile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Multi-stage build for rust-analyzer
22
ARG VERSION=2025-12-15
3-
FROM rust:slim-bookworm AS builder
3+
FROM docker.io/library/rust:slim-bookworm AS builder
44
ARG VERSION
55
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
66

@@ -18,10 +18,15 @@ RUN set -eux; \
1818

1919
FROM gcr.io/distroless/cc-debian12
2020
ARG VERSION
21-
LABEL org.opencontainers.image.version="${VERSION}"
21+
LABEL org.opencontainers.image.title="rust-analyzer" \
22+
org.opencontainers.image.description="Rust Language Server" \
23+
org.opencontainers.image.version="${VERSION}" \
24+
org.opencontainers.image.source="https://github.com/wangbowei/lsp-client" \
25+
org.opencontainers.image.licenses="MIT"
2226

2327
COPY --from=builder /usr/local/bin/rust-analyzer /usr/local/bin/rust-analyzer
2428

2529
WORKDIR /workspace
30+
USER 65532:65532
2631
ENTRYPOINT ["/usr/local/bin/rust-analyzer"]
2732

container/ty/ContainerFile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ ARG VERSION
55
RUN uv tool install ty@${VERSION}
66

77
FROM gcr.io/distroless/cc-debian12
8+
ARG VERSION
9+
LABEL org.opencontainers.image.title="Ty LSP" \
10+
org.opencontainers.image.description="Ty Language Server" \
11+
org.opencontainers.image.version="${VERSION}" \
12+
org.opencontainers.image.source="https://github.com/wangbowei/lsp-client" \
13+
org.opencontainers.image.licenses="MIT"
14+
815
COPY --from=builder /usr/local/bin/ty /usr/local/bin/ty
916

1017
WORKDIR /workspace
18+
USER 65532:65532
1119
ENTRYPOINT ["/usr/local/bin/ty", "server"]

container/typescript/ContainerFile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG VERSION=5.1.3
2-
FROM node:22-alpine AS builder
2+
FROM docker.io/library/node:22-alpine AS builder
33
ARG VERSION
44
WORKDIR /app
55
RUN apk add --no-cache curl && \
@@ -8,12 +8,18 @@ RUN apk add --no-cache curl && \
88
npm prune --production && \
99
/usr/local/bin/node-prune
1010

11-
FROM node:22-alpine
11+
FROM docker.io/library/node:22-alpine
1212
ARG VERSION
13-
LABEL org.opencontainers.image.version="${VERSION}"
13+
LABEL org.opencontainers.image.title="TypeScript LSP" \
14+
org.opencontainers.image.description="TypeScript Language Server" \
15+
org.opencontainers.image.version="${VERSION}" \
16+
org.opencontainers.image.source="https://github.com/wangbowei/lsp-client" \
17+
org.opencontainers.image.licenses="MIT"
18+
1419
WORKDIR /app
1520
COPY --from=builder /app/node_modules ./node_modules
1621
ENV PATH="/app/node_modules/.bin:${PATH}"
1722

1823
WORKDIR /workspace
24+
USER node
1925
ENTRYPOINT ["typescript-language-server", "--stdio"]

0 commit comments

Comments
 (0)