0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

fix(docker): remove yarn symlinks (#3840)

The [`node:alpine` Docker image][1] adds some symlinks to `yarn` in
`/usr/local/bin/`. These should be removed as part of removing `yarn`
from the Verdaccio Docker image, otherwise there will be errors when
a someone tries to re-install `yarn` in their Docker image that builds
on top of the Verdaccio one.

[1]: 02a64a08a9/18/alpine3.16/Dockerfile (L91-L92)
This commit is contained in:
George Kalpakas 2023-05-30 15:53:42 +03:00 committed by GitHub
parent c5afdbbb0c
commit 1a5d5b41d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,14 +16,14 @@ RUN apk add --force-overwrite && \
WORKDIR /opt/verdaccio-build
COPY . .
## build the project and create a tarball of the project for later
## build the project and create a tarball of the project for later
## global installation
RUN yarn config set npmRegistryServer $VERDACCIO_BUILD_REGISTRY && \
yarn config set enableProgressBars true && \
yarn config set enableScripts false && \
yarn install --immutable && \
yarn build
## pack the project
## pack the project
RUN yarn pack --out verdaccio.tgz \
&& mkdir -p /opt/tarball \
&& mv /opt/verdaccio-build/verdaccio.tgz /opt/tarball
@ -53,13 +53,14 @@ COPY --from=builder /opt/tarball .
USER root
# install verdaccio as a global package so is fully handled by npm
# ensure none dependency is being missing and is prod by default
RUN npm install -g $VERDACCIO_APPDIR/verdaccio.tgz \
RUN npm install -g $VERDACCIO_APPDIR/verdaccio.tgz \
## clean up cache
&& npm cache clean --force \
&& rm -Rf .npm/ \
&& rm $VERDACCIO_APPDIR/verdaccio.tgz \
# yarn is not need it after this step
&& rm -Rf /opt/yarn-v1.22.19/
# Also remove the symlinks added in the [`node:alpine` Docker image](https://github.com/nodejs/docker-node/blob/02a64a08a98a472c6141cd583d2e9fc47bcd9bfd/18/alpine3.16/Dockerfile#L91-L92).
&& rm -Rf /opt/yarn-v1.22.19/ /usr/local/bin/yarn /usr/local/bin/yarnpkg
ADD conf/docker.yaml /verdaccio/conf/config.yaml
ADD docker-bin $VERDACCIO_APPDIR/docker-bin