How can I install package from private repository using docker

前端 未结 1 494
青春惊慌失措
青春惊慌失措 2021-01-27 05:44

I am installing a package from my private repository. I am able to install it using: npm i -S git+https://oauth2:XXXXXXX@gitlab.com/mygroup/acl-api.git

I am

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-27 06:19

    You should add git and openssh-client and other packages if you want to the node:alpine to let npm pull the repository

    FROM node:alpine
    
    RUN apk add --update \
      python \
      python-dev \
      py-pip \
      build-base \
      git \
      openssh-client \
    && pip install virtualenv \
    && rm -rf /var/cache/apk/*
    
    COPY package.json package.json
    COPY src src
    COPY .babelrc .babelrc
    
    RUN npm install  
    RUN npm run gitlab-build
    
    RUN ls
    EXPOSE 8080
    CMD ["npm", "run", "docker-start"]
    

    0 讨论(0)
提交回复
热议问题