Docker node flow-bin libelf.so.1 not found (gitlab ci)

时间:2016-08-31 12:30:50

标签: node.js docker gitlab gitlab-ci gitlab-ci-runner

While running FlowJS check node_modules/.bin/flow check inside docker image based on node:latest (currently 6.5)

You see error

$ npm i

...

npm info lifecycle flow-bin@0.31.1~postinstall: flow-bin@0.31.1

> flow-bin@0.31.1 postinstall .../node_modules/flow-bin
> node lib/install.js

✖ The `.../node_modules/flow-bin/vendor/flow` binary doesn't seem to work correctly
✖ flow binary test failed

...

$ node_modules/.bin/flow check
.../node_modules/flow-bin/vendor/flow: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
ERROR: Build failed: exit code 1

E.g. flow cannot be run under vanilla node:latest docker image

1 个答案:

答案 0 :(得分:1)

Related issue https://github.com/facebook/flow/issues/210

In case your image is from node:latest (which is debian:jessie under the hood) you need to add a little bit update to apt:

$ apt-get update -qq
$ apt-get install -qy libelf1

before any runs (e.g. in Dockerfile or corresponding section of .gitlab-ci.yml)