English 中文(简体)
• 如何建立私人npm登记处认证 do户档案
原标题:How to setup private npm registry authentication in dockerfile

目前,我使用自己的私人午餐。

在我的地方,我总是需要首先向我自己的私人广场登记,并为我的项目安装所有包裹。

npm login --registry https://nodenpm.XXXX.co  # to login private npm registry
 > Enter username
 > Enter password
npm install --registry https://nodenpm.XXXX.co  # to install the deps from private registry

在码头档案中,我是如何在我自己的私人广场和安装的。

这是我的cker子。

FROM ubuntu:22.04

WORKDIR /app

RUN npm login --registry=https://nodenpm.XXXX.co -u <username> -p <password>

RUN npm install --registry https://nodenpm.XXXX.co --save

RUN npm run build

EXPOSE 80
CMD [ "node", "/app/dist/main" ]

但是,它未能在cker子里建树。

问题回答

由于安全风险,建议不要将用户和密码证书直接列入Dockerfile。 相反,你应在<条码>上存储Npm登记全权证书。

您应从您的cker本中删除npmlogin,将nnpmrc文档编成。 Docker Secret in the right path (Typically, the npmrc file is found at$HOME/.npmrc).





相关问题
Unable to connect to docker container inside windows server

As title. I am developing a system with many docker images with ASP.Net MVC core projects. I am publishing these docker images into a docker engine installed on Windows Server OS, and I found that I ...

Only can see postgreSQL as an admin

After installed Wsl and Docker, can t access PSQL and other things. I was studying Docker, and installed the latest version. So far so good, I received an error about the WSL version, saw some ...

make docker-compose block until healthy without `depends_on`

I am working with a team that uses docker-compose to start a set of helper services, but does not use docker when the code is being developed. Here, docker-compose is just a convenient way to run the ...

change grafana port using docker host network

I am trying to spin up a grafana container in docker, however my setup in docker does not allow ipv4 forwarding and thus I cannot use the default bridge network in docker. All I can use is the host ...

Pip instalation for Python 3.11 in docker

I have Dockerfile to build image for Django project that uses Python 3.11 and runs in poetry environment (see content below). Problem is when I try to donwload get-pip.py file and run it using Python, ...

在 Dockerfile 中运行 composer install

我正在尝试将我的Laravel应用程序进行Docker化。 该应用程序已经构建并在Git中,但我将vendor文件夹添加到了.gitignore中。 我添加了一个Dockerfile,看起来像这样: FROM php:7.1-fpm-alpine RUN apk update ...

热门标签