mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-02-01 22:48:03 +00:00
Revert "Update package.json in include git dependency on Ink fork." (#11365)
This commit is contained in:
44
Dockerfile
44
Dockerfile
@@ -1,4 +1,4 @@
|
||||
FROM docker.io/library/node:20-slim AS base
|
||||
FROM docker.io/library/node:20-slim
|
||||
|
||||
ARG SANDBOX_NAME="gemini-cli-sandbox"
|
||||
ARG CLI_VERSION_ARG
|
||||
@@ -36,43 +36,15 @@ RUN mkdir -p /usr/local/share/npm-global \
|
||||
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
|
||||
ENV PATH=$PATH:/usr/local/share/npm-global/bin
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
# switch to non-root user node for npm installs
|
||||
USER node
|
||||
|
||||
# install build tooling needed by git-based dependencies
|
||||
RUN npm install -g typescript
|
||||
|
||||
# pull in pre-built package tarballs
|
||||
COPY packages/cli/dist/google-gemini-cli-*.tgz /tmp/gemini-cli.tgz
|
||||
COPY packages/core/dist/google-gemini-cli-core-*.tgz /tmp/gemini-core.tgz
|
||||
|
||||
# install packages into a temporary prefix (non-global) so git dependencies can build correctly
|
||||
RUN npm install --prefix /tmp/gemini-install /tmp/gemini-cli.tgz /tmp/gemini-core.tgz \
|
||||
&& mkdir -p /tmp/gemini-install/lib \
|
||||
&& mv /tmp/gemini-install/node_modules /tmp/gemini-install/lib/node_modules \
|
||||
&& mkdir -p /tmp/gemini-install/bin \
|
||||
&& if [ -d /tmp/gemini-install/lib/node_modules/.bin ]; then \
|
||||
for bin in /tmp/gemini-install/lib/node_modules/.bin/*; do \
|
||||
name=$(basename "$bin"); \
|
||||
ln -sf "../lib/node_modules/.bin/${name}" "/tmp/gemini-install/bin/${name}"; \
|
||||
done; \
|
||||
fi \
|
||||
&& npm cache clean --force \
|
||||
&& rm -f /tmp/gemini-{cli,core}.tgz
|
||||
|
||||
FROM base
|
||||
|
||||
# copy the pre-built global installation from the builder stage
|
||||
COPY --from=builder /tmp/gemini-install/lib /usr/local/share/npm-global/lib
|
||||
COPY --from=builder /tmp/gemini-install/bin /usr/local/share/npm-global/bin
|
||||
|
||||
# ensure node user owns the global npm prefix contents
|
||||
RUN chown -R node:node /usr/local/share/npm-global
|
||||
|
||||
# switch to non-root user node
|
||||
USER node
|
||||
|
||||
# install gemini-cli and clean up
|
||||
COPY packages/cli/dist/google-gemini-cli-*.tgz /tmp/gemini-cli.tgz
|
||||
COPY packages/core/dist/google-gemini-cli-core-*.tgz /tmp/gemini-core.tgz
|
||||
RUN npm install -g /tmp/gemini-cli.tgz /tmp/gemini-core.tgz \
|
||||
&& npm cache clean --force \
|
||||
&& rm -f /tmp/gemini-{cli,core}.tgz
|
||||
|
||||
# default entrypoint when none specified
|
||||
CMD ["gemini"]
|
||||
|
||||
Reference in New Issue
Block a user