|
1 |
| -# Keep in sync with Dockerfile.autoindex |
2 |
| -FROM node:20.8.1-alpine3.18@sha256:1ccb0c0ded3b21cee95fe6b6ce1ac23bd6680c8f152cbfb3047d5d9ea490b098 |
| 1 | +# When updating the version of the base container, please use the |
| 2 | +# SHA256 listed under 'Index digest' on Docker Hub, |
| 3 | +# not the 'Manifest digest'. |
| 4 | +# |
| 5 | +# This ensures that when pulling the container, Docker will detect |
| 6 | +# the platform and pull the correct image (if it exists) |
| 7 | +# |
| 8 | +# Alternate way of determining the Index digest using the docker CLI. |
| 9 | +# |
| 10 | +# $ docker buildx imagetools inspect node:22.12.0-slim |
| 11 | +# Name: docker.io/library/node:22.12.0-slim |
| 12 | +# MediaType: application/vnd.oci.image.index.v1+json |
| 13 | +# Digest: sha256:a4b757cd491c7f0b57f57951f35f4e85b7e1ad54dbffca4cf9af0725e1650cd8 |
| 14 | +# And use this digest in FROM |
| 15 | +ARG base_sha=a4b757cd491c7f0b57f57951f35f4e85b7e1ad54dbffca4cf9af0725e1650cd8 |
3 | 16 |
|
4 |
| -ARG TAG |
| 17 | +FROM node:22.12.0-slim@sha256:${base_sha} |
5 | 18 |
|
6 |
| -RUN apk add --no-cache git curl |
| 19 | +ENV NODE_OPTIONS=--max-old-space-size=4096 |
7 | 20 |
|
8 |
| -RUN yarn global add npm yarn |
| 21 | +RUN apt update && \ |
| 22 | + apt install -y git bash curl ca-certificates python3 make build-essential automake autoconf curl && \ |
| 23 | + rm -rf /var/lib/apt/lists/* && \ |
| 24 | + npm install -g n yarn pnpm --force |
9 | 25 |
|
10 |
| -RUN yarn global add @sourcegraph/scip-typescript@${TAG} @sourcegraph/src |
| 26 | +WORKDIR /app |
11 | 27 |
|
12 |
| -CMD ["/bin/sh"] |
| 28 | +COPY . . |
| 29 | +RUN npm install && npm run build && npm install -g . |
| 30 | + |
| 31 | +WORKDIR /src |
| 32 | + |
| 33 | +RUN mv /usr/local/bin/yarn /usr/local/bin/actual-yarn |
| 34 | +COPY ./dev/lenient-yarn.sh /usr/local/bin/yarn |
| 35 | + |
| 36 | +RUN mv /usr/local/bin/npm /usr/local/bin/actual-npm |
| 37 | +COPY ./dev/lenient-npm.sh /usr/local/bin/npm |
| 38 | + |
| 39 | +RUN mv /usr/local/bin/n /usr/local/bin/actual-n |
| 40 | +COPY ./dev/lenient-n.sh /usr/local/bin/n |
| 41 | + |
| 42 | +ENTRYPOINT ["scip-typescript"] |
0 commit comments