mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
50 lines
1.3 KiB
Docker
50 lines
1.3 KiB
Docker
FROM docker.io/library/node:20-slim
|
|
|
|
ARG SANDBOX_NAME="qwen-code-sandbox"
|
|
ARG CLI_VERSION_ARG
|
|
ENV SANDBOX="$SANDBOX_NAME"
|
|
ENV CLI_VERSION=$CLI_VERSION_ARG
|
|
|
|
# install minimal set of packages, then clean up
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 \
|
|
make \
|
|
g++ \
|
|
man-db \
|
|
curl \
|
|
dnsutils \
|
|
less \
|
|
jq \
|
|
bc \
|
|
gh \
|
|
git \
|
|
unzip \
|
|
rsync \
|
|
ripgrep \
|
|
procps \
|
|
psmisc \
|
|
lsof \
|
|
socat \
|
|
ca-certificates \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# set up npm global package folder under /usr/local/share
|
|
# give it to non-root user node, already set up in base image
|
|
RUN mkdir -p /usr/local/share/npm-global \
|
|
&& chown -R node:node /usr/local/share/npm-global
|
|
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
|
|
ENV PATH=$PATH:/usr/local/share/npm-global/bin
|
|
|
|
# switch to non-root user node
|
|
USER node
|
|
|
|
# install qwen-code and clean up
|
|
COPY packages/cli/dist/qwen-code-*.tgz /usr/local/share/npm-global/qwen-code.tgz
|
|
COPY packages/core/dist/qwen-code-qwen-code-core-*.tgz /usr/local/share/npm-global/qwen-code-core.tgz
|
|
RUN npm install -g /usr/local/share/npm-global/qwen-code.tgz /usr/local/share/npm-global/qwen-code-core.tgz \
|
|
&& npm cache clean --force \
|
|
&& rm -f /usr/local/share/npm-global/qwen-{code,code-core}.tgz
|
|
|
|
# default entrypoint when none specified
|
|
CMD ["qwen"] |