windows7 docker-compose の npm installでエラー

イシュー

  • ようやくwindows7 docker-compose で、mysql が動いて angularの環境を整えようと思ったら、またnpm installでエラー

内容

root@e3f7d6a3b4b2:/var/www/projects/relief-form# npm install angular-cli --save
npm WARN deprecated angular-cli@1.0.0-beta.28.3: angular-cli has been renamed to @angular/cli. Please update your dependencies.
npm WARN deprecated gulp-util@3.0.7: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN enoent ENOENT: no such file or directory, open '/var/www/projects/relief-form/package.json'
npm WARN @angular/core@2.4.10 requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN relief-form No description
npm WARN relief-form No repository field.
npm WARN relief-form No README data
npm WARN relief-form No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mkdirp@0.5.1 (node_modules/@angular-cli/ast-tools/node_modules/mkdirp):
npm WARN rofs SKIPPING OPTIONAL DEPENDENCY: EROFS: read-only file system, symlink '../mkdirp/bin/cmd.js' -> '/var/www/projects/relief-form/node_modules/@angular-cli/ast-tools/node_modules/.bin/mkdirp'

npm ERR! path ../typescript/bin/tsc
npm ERR! code EROFS
npm ERR! errno -30
npm ERR! syscall symlink
npm ERR! rofs EROFS: read-only file system, symlink '../typescript/bin/tsc' -> '/var/www/projects/relief-form/node_modules/@angular-cli/ast-tools/node_modules/.bin/tsc'
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-02-02T10_22_18_409Z-debug.log
root@e3f7d6a3b4b2:/var/www/projects/relief-form# ls

mount bind

virtualbox x シンボリックリンク

npm install でKilledされた

angular プロジェクトで、npm install したら、not found: python

gyp verb `which` failed Error: not found: python

ng build 時にエラー

TypeError: Cannot destructure property `bold` of 'undefined' or 'null'.
参考

バージョンを確認する

(動いている)開発環境のバージョン
$ ng --version
@angular/cli: 1.4.9
node: 6.9.5

$ python --version          
Python 2.7.12

(エラーになった)Docker環境のバージョン

$ ng --version
Angular CLI: 1.6.7
Node: 9.5.0
OS: linux x64

$ python -V
Python 2.7.12

typescriptなしで入れなおした

$ ng --version
Angular CLI: 1.6.7
Node: 8.9.4
OS: linux x64
Angular: error
... cli, common, compiler, compiler-cli, core, forms, http
... platform-browser, platform-browser-dynamic, router

typescript: error
webpack: error
$

Python でも落ちる

ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_PYTHON} = true ]; then   apt-get update   && apt-get -y install python python-pip python-dev build-essential    && pip install --upgrade pip    && pip install --upgrade virtualenv ;fi' returned a non-zero code: 100
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python-defaults/
python-minimal_2.7.11-1_amd64.deb  Bad header line Bad header data [IP: 91.189.8
8.149 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpyt
hon2.7-stdlib_2.7.12-1ubuntu0~16.04.3_amd64.deb  Bad header line Bad header data
 [IP: 91.189.88.162 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python-defaults/
libpython-stdlib_2.7.11-1_amd64.deb  Bad header line Bad header data [IP: 91.189
.88.152 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-mis
sing?
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTA
LL_PYTHON} = true ]; then   apt-get update   && apt-get -y install python python
-pip python-dev build-essential    && pip install --upgrade pip    && pip instal
l --upgrade virtualenv ;fi' returned a non-zero code: 100
参考

古いイメージを削除する

docker images | awk 'NR>1 {print $3}' | xargs docker rmi

イメージを取得しなおす

bad header エラー

Err:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-minimal amd64 2.7.11-1

参考

/etc/apt/souces.list を編集する

docker-compose で dns が設定できる(情報古い)

apt /sources.list

docker-daemon

/var/lib/boot2docker/profile
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTA
LL_PYTHON} = true ]; then   apt-get -yqq update   && apt-get -y install python2.
7 python-pip python-dev build-essential    && pip install --upgrade pip    && pi
p install --upgrade virtualenv ;fi' returned a non-zero code: 100
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpyt
hon2.7-stdlib_2.7.12-1ubuntu0~16.04.3_amd64.deb  Bad header line Bad header data
 [IP: 91.189.88.152 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-mis
sing?

docker-machine い

sudo vi /etc/resolv.conf

で、nameserver 8.8.8.8 を追加したら、インストールできた。

apt-get -o Acquire::Queue-mode=access -o Acquire::http::Dl-Limit=70 -y install python2.7 python-pip python-dev build-essential

apt.conf.d の種類

ディスクがいっぱいになった