使用私有svn bower在dockerfile中不起作用

前端之家收集整理的这篇文章主要介绍了使用私有svn bower在dockerfile中不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我一直在尝试使用docker来运行我的开发环境.
我的堆栈有一个私人的bower注册表,在我的$HOME中需要一个.bowerrc.

我的.bowerrc文件的格式是:

/home/.bowerrc(在我的docker中作为卷安装)

{
  "registry": "https://

我在docker文件中挂载此文件方法是使用以下命令:

docker run -it --net='host' -v $(pwd):/home/dev/app -v /home/USER/.dockershared/.bowerrc:/home/.bowerrc --name="myproject" --privileged bower-gulp:node0.12

我的Dockerfile是为支持使用bower,gulp和svn的环境而构建的.这是Dockerfile

FROM node:0.12-wheezy
RUN useradd -ms /bin/bash dev
RUN chown -R dev:dev /home/dev
USER dev
ENV HOME /home/dev
ENV PATH "$PATH:/home/dev/.npm-global/bin"
WORKDIR /home/dev/app

RUN mkdir /home/dev/.npm-global && \
    npm config set prefix '/home/dev/.npm-global' && \
    npm install -g bower gulp && \
    apt-get install subversion

ENTRYPOINT ["/bin/sh","-c","/bin/bash"]

我使用bower install命令的package.json文件是这样的:

{
    "name": "my_project","version": "3.1.3","description": "","author": "","license": "ISC","repository": {
        "type": "svn","url": "https://svn.mycompany.com/repos/My_repo"
    },"devDependencies": {
        "bower": "1.x","del": "^2.2.0","gulp": "3.x","gulp-maven-deploy": "^0.2.0","gulp-rename": "^1.2.2","gulp-template": "^3.1.0","node-rest-client": "^1.8.0","run-sequence": "^1.1.5","svn-npm-crutch": "0.x"
    },"svnDependencies": {
        "framework-tools-build": "https://svn.mycompany.com/repos/tools/build/trunk","framework-tools-functional-testing": "https://svn.mycompany.com/repos/tools/functional-testing/trunk"

    },"engines": {
        "node": ">=0.8.0"
    },"scripts": {
        "install": "bower install -F --allow-root && node ./node_modules/svn-npm-crutch/lib/svn-npm-crutch.js","demo-mode": "gulp functional-test --browser=chrome --demo"
    },"config": {
        "unsafe-perm": true
    }
}

最后,当我尝试npm install或bower install时,我收到此错误

bower ECMDERR       Failed to execute "svn list https://svn.mycompany.com/repos/ui/common/tags --verbose --non-interactive",exit code of #1 svn: OPTIONS of 'https://svn.mycompany.com/repos/ui/common/tags': authorization Failed: Could not authenticate to server: rejected Basic challenge (https://svn.mycompany.com)

Additional error details:
svn: OPTIONS of 'https://svn.mycompany.com/repos/ui/common/tags': authorization Failed: Could not authenticate to server: rejected Basic challenge (https://svn.mycompany.com)

有谁能帮我理解这个?

最佳答案
最后我明白了这个问题.

应该在docker容器内接受SVN证书.
为了做到这一点,在docker容器内,使用interactive-attach模式-ia进入并使用入口点/ bin / bash控制台,我运行了以下命令:

svn info< any_svn_respository_of_my_company>

svn info https://svn.mycompany.com/repos/ui/common/.

然后我接受了证书,一切正常!

原文链接:https://www.f2er.com/docker/435758.html

猜你在找的Docker相关文章