|
1 | | -FROM verdaccio/verdaccio:4.6.2 as builder |
| 1 | +FROM node:12.16.3-alpine3.11 as builder |
2 | 2 |
|
3 | | -ENV NODE_ENV=production \ |
4 | | - VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org |
5 | | - |
6 | | -USER root |
| 3 | +WORKDIR /opt/verdaccio-gitlab-build |
7 | 4 |
|
8 | | -RUN apk --no-cache add openssl ca-certificates wget && \ |
9 | | - apk --no-cache add g++ gcc libgcc libstdc++ linux-headers git make python && \ |
10 | | - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ |
11 | | - wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \ |
12 | | - apk add glibc-2.25-r0.apk |
| 5 | +RUN apk --no-cache add git openssh |
| 6 | +RUN git clone https://github.com/bufferoverflow/verdaccio-gitlab.git . |
13 | 7 |
|
14 | | -WORKDIR /opt/verdaccio-build |
| 8 | +ENV NODE_ENV=production \ |
| 9 | + VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org/ |
15 | 10 |
|
16 | | -RUN git clone https://github.com/bufferoverflow/verdaccio-gitlab.git && \ |
17 | | - cd verdaccio-gitlab && \ |
18 | | - yarn config set registry $VERDACCIO_BUILD_REGISTRY && \ |
| 11 | +RUN yarn config set registry $VERDACCIO_BUILD_REGISTRY && \ |
19 | 12 | yarn install --production=false && \ |
20 | 13 | yarn code:docker-build && \ |
21 | 14 | yarn cache clean && \ |
22 | 15 | yarn install --production=true --pure-lockfile |
23 | 16 |
|
24 | | -FROM verdaccio/verdaccio:4.6.2 |
25 | 17 |
|
26 | | -LABEL maintainer="https://github.com/verdaccio/verdaccio" |
27 | 18 |
|
28 | | -ENV VERDACCIO_APPDIR=/opt/verdaccio \ |
29 | | - VERDACCIO_USER_NAME=verdaccio \ |
30 | | - VERDACCIO_USER_UID=10001 \ |
31 | | - VERDACCIO_PORT=4873 \ |
32 | | - VERDACCIO_PROTOCOL=http |
33 | | -ENV PATH=$VERDACCIO_APPDIR/docker-bin:$PATH \ |
34 | | - HOME=$VERDACCIO_APPDIR |
| 19 | +FROM verdaccio/verdaccio:4.6.2 |
| 20 | +LABEL maintainer="https://github.com/bufferoverflow/verdaccio-gitlab" |
35 | 21 |
|
36 | | -WORKDIR $VERDACCIO_APPDIR |
| 22 | +# Go back to root to be able to install the plugin |
| 23 | +USER root |
37 | 24 |
|
38 | | -RUN npm install -g verdaccio-gitlab |
| 25 | +COPY --from=builder /opt/verdaccio-gitlab-build/build /opt/verdaccio-gitlab/build |
| 26 | +COPY --from=builder /opt/verdaccio-gitlab-build/package.json /opt/verdaccio-gitlab/package.json |
| 27 | +COPY --from=builder /opt/verdaccio-gitlab-build/node_modules /opt/verdaccio-gitlab/node_modules |
39 | 28 |
|
40 | | -COPY --from=builder /opt/verdaccio-build/verdaccio-gitlab/build /verdaccio/plugins/verdaccio-gitlab |
| 29 | +# Inherited from parent image |
| 30 | +WORKDIR $VERDACCIO_APPDIR |
| 31 | +RUN ln -s /opt/verdaccio-gitlab/build /verdaccio/plugins/verdaccio-gitlab |
41 | 32 |
|
| 33 | +# Inherited from parent image |
42 | 34 | USER $VERDACCIO_USER_UID |
0 commit comments