とある開発環境をLaradockで構築しており、久しぶりに起動してみることに。
コンテナをbuildしていくと、途中で落ちる現象にぶち当たる。
=> ERROR [laradock_workspace 54/92] RUN if [ true = true ]; then mk 34.7s
------
> [laradock_workspace 54/92] RUN if [ true = true ]; then mkdir -p /home/laradock/.nvm && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && . /home/laradock/.nvm/nvm.sh && nvm install node && nvm use node && nvm alias node && if [ ]; then npm config set registry ;fi && if [ true = true ]; then npm install -g gulp ;fi && if [ false = true ]; then npm install -g bower ;fi && if [ true = true ]; then npm install -g @vue/cli ;fi && if [ false = true ]; then npm install -g @angular/cli ;fi && ln -s `npm bin --global` /home/laradock/.node-bin ;fi:
#0 0.260 % Total % Received % Xferd Average Speed Time Time Time Current
#0 0.268 Dload Upload Total Spent Left Speed
100 12819 100 12819 0 0 15831 0 --:--:-- --:--:-- --:--:-- 15924
#0 1.091 => Downloading nvm from git to '/home/laradock/.nvm'
=> Cloning into '/home/laradock/.nvm'...
#0 2.918 => Compressing and cleaning up git repository
#0 2.970
#0 3.031 => Appending nvm source string to /home/laradock/.bashrc
#0 3.058 => Appending bash_completion source string to /home/laradock/.bashrc
#0 3.206 => Installing Node.js version node
#0 13.11 Downloading and installing node v19.3.0...
#0 13.88 Downloading https://nodejs.org/dist/v19.3.0/node-v19.3.0-linux-x64.tar.xz...
######################################################################## 100.0%
#0 15.90 Computing checksum with sha256sum
#0 16.19 Checksums matched!
#0 22.75 node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
#0 22.75 node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
#0 22.75 node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
#0 22.85 nvm is not compatible with the npm config "prefix" option: currently set to ""
#0 22.85 Run `nvm use --delete-prefix v19.3.0` to unset it.
#0 23.71 Failed to install Node.js node
#0 23.71 => Close and reopen your terminal to start using nvm or run the following to use it now:
#0 23.71
#0 23.71 export NVM_DIR="$HOME/.nvm"
#0 23.71 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#0 23.71 [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#0 32.22 v19.3.0 is already installed.
#0 32.76 node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
#0 32.76 node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
#0 32.76 node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
#0 32.84 nvm is not compatible with the npm config "prefix" option: currently set to ""
#0 32.84 Run `nvm use --delete-prefix v19.3.0` to unset it.
#0 33.53 Creating default alias: default -> node (-> v19.3.0)
#0 34.55 node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
#0 34.55 node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
#0 34.55 node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
#0 34.63 nvm is not compatible with the npm config "prefix" option: currently set to ""
#0 34.63 Run `nvm use --delete-prefix v19.3.0` to unset it.
以前は正常に起動していたのに。
なぜ・・・・。
エラーを見ると、version `GLIBC_2.28′ not found。
要するに無いよ。と怒られる。
nodeのバージョンによってはこの現状が出てくるとか。
ということで、原因はnodeのバージョン。
https://github.com/laradock/laradock/issues/1564#issuecomment-423705186
envファイルを見ると
###########################################################
################ Containers Customization #################
###########################################################
### WORKSPACE #############################################
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
....
WORKSPACE_INSTALL_NODE=true
WORKSPACE_NODE_VERSION=node
nodeのバージョンは特に指定していない。
ということは最新が当たってしまっている。
なので、nodeのバージョンを指定することで無事解決。
#WORKSPACE_NODE_VERSION=node
WORKSPACE_NODE_VERSION=v10.24.1