D
D
Dmitry2016-11-30 13:55:01
Docker
Dmitry, 2016-11-30 13:55:01

Does Docker handle commands differently?

Hello All!
The question is simple, there is Jenkins which, as a standard, when updating a branch, updates and builds the project. Build in fact - in turn, the execution of a list of commands. So, everything crashes on one command, namely, when after
Jenkins updates the catalog:
docker exec -i workspace git -C /var/www// pull
after it goes

docker exec -i workspace composer install -d /var/www/

and here is the problem, the command sent to the container from the outside - falls with an error:
[email protected] install /var/www/staging/laravel/node_modules/node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v11-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v11 ABI) (falling back to source compile with node-gyp) 
make: Entering directory '/var/www/staging/laravel/node_modules/node-zopfli/build'
  CXX(target) Release/obj.target/zopfli/src/zopfli-binding.o
In file included from ../src/zopfli-binding.h:5:0,
                 from ../src/zopfli-binding.cc:3:
../../nan/nan.h:324:47: error: 'REPLACE_INVALID_UTF8' is not a member of 'v8::String'
   static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;

I understand that he needs to install the zopfli library, but it is not available, but then why when I go into the container and run the same command - the project is built without problems?
Today they removed the lib that pulled up zopfli - the problem did not go away. I don't know where to dig anymore.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-12-23
@Demi44

The solution turned out to be nowhere simpler, I found out the problem after it turned out that I had two versions of node in my container,
this option showed one version

docker exec -i workspace node --version
docker exec -i workspace which node

and inside the container - another. It became clear that when executing commands, different node. After inventorying the Dockerfile and recreating the base image with the correct versions and paths, the problem disappeared

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question