mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -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:
parent
c5afdbbb0c
commit
1a5d5b41d5
1 changed files with 5 additions and 4 deletions
|
@ -16,14 +16,14 @@ RUN apk add --force-overwrite && \
|
||||||
WORKDIR /opt/verdaccio-build
|
WORKDIR /opt/verdaccio-build
|
||||||
COPY . .
|
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
|
## global installation
|
||||||
RUN yarn config set npmRegistryServer $VERDACCIO_BUILD_REGISTRY && \
|
RUN yarn config set npmRegistryServer $VERDACCIO_BUILD_REGISTRY && \
|
||||||
yarn config set enableProgressBars true && \
|
yarn config set enableProgressBars true && \
|
||||||
yarn config set enableScripts false && \
|
yarn config set enableScripts false && \
|
||||||
yarn install --immutable && \
|
yarn install --immutable && \
|
||||||
yarn build
|
yarn build
|
||||||
## pack the project
|
## pack the project
|
||||||
RUN yarn pack --out verdaccio.tgz \
|
RUN yarn pack --out verdaccio.tgz \
|
||||||
&& mkdir -p /opt/tarball \
|
&& mkdir -p /opt/tarball \
|
||||||
&& mv /opt/verdaccio-build/verdaccio.tgz /opt/tarball
|
&& mv /opt/verdaccio-build/verdaccio.tgz /opt/tarball
|
||||||
|
@ -53,13 +53,14 @@ COPY --from=builder /opt/tarball .
|
||||||
USER root
|
USER root
|
||||||
# install verdaccio as a global package so is fully handled by npm
|
# install verdaccio as a global package so is fully handled by npm
|
||||||
# ensure none dependency is being missing and is prod by default
|
# 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
|
## clean up cache
|
||||||
&& npm cache clean --force \
|
&& npm cache clean --force \
|
||||||
&& rm -Rf .npm/ \
|
&& rm -Rf .npm/ \
|
||||||
&& rm $VERDACCIO_APPDIR/verdaccio.tgz \
|
&& rm $VERDACCIO_APPDIR/verdaccio.tgz \
|
||||||
# yarn is not need it after this step
|
# 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 conf/docker.yaml /verdaccio/conf/config.yaml
|
||||||
ADD docker-bin $VERDACCIO_APPDIR/docker-bin
|
ADD docker-bin $VERDACCIO_APPDIR/docker-bin
|
||||||
|
|
Loading…
Add table
Reference in a new issue