gpt4 book ai didi

docker - 在不同环境下运行docker-build的不一致

转载 作者:行者123 更新时间:2023-12-02 19:36:27 25 4
gpt4 key购买 nike

在本地,一切运行顺利且完美:

  • Mac OS 10.11.6
  • Docker 17.03.1-ce-mac12

  • 从远程来看,在CircleCI上是不同的:
  • Ubuntu 14.04
  • Docker版本1.9.1-circleci-cp-workaround
  • 我正在使用CircleCI 1.0,我曾短暂尝试过使用CircleCI 2.0

  • 我的Dockerfile看起来与此非常相似:
    FROM pensiero/apache-php

    # Mostly Ubuntu 16.04 install with some php and node / npm

    # RUN apt-get install a few packages

    COPY . /var/www
    WORKDIR /var/www

    RUN ["npm","install"]
    # or RUN npm install

    然后混乱被释放,所有的幸福消失了:
    npm WARN deprecated bower@1.8.0: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and Webpack's is support for both CommonJS and AMD projects. Currently there's no migration path but we hope you'll help us figure out one.
    npm WARN deprecated babel@6.23.0: In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers


    # This one is only there from time to time
    npm ERR! Cannot read property 'write' of null



    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lodash@4.17.4 (node_modules/babel-traverse/node_modules/lodash):
    npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chown '/var/www/node_modules/.staging/lodash-23934876/camelCase.js'
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: base62@1.2.0 (node_modules/base62):
    npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, chown '/var/www/node_modules/.staging/base62-c9d76f67/.travis.yml'

    ... bunch of similar lines


    npm ERR! path /var/www/node_modules/.staging/react-dom-414d50ba
    npm ERR! code EINVAL
    npm ERR! errno -22
    npm ERR! syscall chown
    npm ERR! EINVAL: invalid argument, chown '/var/www/node_modules/.staging/react-dom-414d50ba'

    npm ERR! A complete log of this run can be found in:
    npm ERR! /root/.npm/_logs/2017-06-13T13_25_03_833Z-debug.log

    显示问题的环境的docker信息:
    Containers: 0
    Images: 0
    Server Version: 1.9.1-circleci-cp-workaround
    Storage Driver: btrfs
    Execution Driver: lxc-1.0.9
    Logging Driver: json-file
    Kernel Version: 3.13.0-119-generic
    Operating System: Ubuntu 14.04.4 LTS (containerized)
    CPUs: 2
    Total Memory: 58.97 GiB
    Name: box731
    ID: 7CUB:SOW3:C3EG:LNFC:JWZB:O73I:PFPI:4XLM:NXDI:V44F:XEFB:IGTV
    Debug mode (server): true
    File Descriptors: 12
    Goroutines: 17
    System Time: 2017-06-13T15:32:31.903542525Z
    EventsListeners: 0
    Init SHA1:
    Init Path: /usr/bin/docker
    Docker Root Dir: /var/lib/docker
    WARNING: No swap limit support
    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

    随机出现的错误使我发出 https://github.com/moby/moby/issues/783,它引用了有关应修复的AUFS的错误。而且似乎我没有使用AUFS ...所以这可能无关紧要。

    如果我删除产生错误的行,则可以稍后使用CircleCI文档中建议的 npm install补丁来运行 docker exec
    sudo lxc-attach -n "$(docker inspect --format "{{.Id}}" test)" -- bash -c "cd /var/www; npm install"

    而且它工作正常,尽管我希望获得一个发布的构建 Artifact ...并且像这样的持久运行并未持久。

    提前致谢。

    最佳答案

    听起来好像是https://discuss.circleci.com/t/npm-install-error-that-isnt-reproducing-in-a-local-docker-container/13085上已经报道过的东西。可能值得关注该线程以了解何时有修复程序。它可能与CircleCI特别相关。

    关于docker - 在不同环境下运行docker-build的不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44526038/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com