thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
785 stars 138 forks source link

Command NPM not found #326

Closed defser closed 2 years ago

defser commented 2 years ago

Hello,

We're experiencing a error when using the latest image after the changes from today.

Images used: thecodingmachine/php:8.0-v4-fpm-node16 build : docker.io/thecodingmachine/php@sha256:ee7e0a414bae3c256ac5874403d3b53a918a4ffb3f62bf8d60b8244ea88ecf03

bash: npm: command not found

Could you take a look?

mistraloz commented 2 years ago

It's maybe related to #327

bbprojectnet commented 2 years ago

Same here :(

defser commented 2 years ago

@mistraloz i do not see the nodejs commands in the image layer details. (thecodingmachine/php:8.0-v4-fpm-node16)

You can see the possibly missing commands at: (8.1.6-v4-fpm-node16) https://hub.docker.com/layers/php/thecodingmachine/php/8.1.6-v4-fpm-node16/images/sha256-b62dc7f26ec6f01e7b7f5a43529c434f94eeac9f0343b974cd8d5e7a2b1a9b59?context=explore

defser commented 2 years ago

The commands missing in thecodingmachine/php:8.0-v4-fpm-node16

ARG NODE_VERSION

RUN |3 PHP_EXTENSIONS= INSTALL_CRON=1 **NODE_VERSION**= /bin/sh -c if [ -n "$**NODE_VERSION**" ]; then sudo apt-get update && sudo apt-get install -y --no-install-recommends gnupg && curl -sL https://deb.nodesource.com/setup_${**NODE_VERSION**}.x | sudo bash - && sudo apt-get update && sudo apt-get install -y --no-install-recommends nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && sudo apt-get update && sudo apt-get install -y --no-install-recommends yarn && sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; fi; # buildkit

i think the nodejs package is simply not installed on php:8.0-v4-fpm-node16.

defser commented 2 years ago

@mistraloz i think it is not related to #327 because php:8.0-v4-fpm-node16 implies that node16 is installed but it is not.

See image: https://hub.docker.com/layers/php/thecodingmachine/php/8.0-v4-fpm-node16/images/sha256-08d8923af33b90d8676fd9ec88fb29beef2cad9e1d85c5ec46205b54961cad53?context=explore

Also the COMPRESSED SIZE = 97.06 MB which is very low comparing to 8.1.6-v4-fpm-node16 (COMPRESSED SIZE 289.52 MB)

https://hub.docker.com/layers/php/thecodingmachine/php/8.1.6-v4-fpm-node16/images/sha256-b62dc7f26ec6f01e7b7f5a43529c434f94eeac9f0343b974cd8d5e7a2b1a9b59?context=explore

mistraloz commented 2 years ago

You have right. Thx for your investigation. I hotfixed it. Can you try again :

docker pull docker.io/thecodingmachine/php:8.0-v4-fpm-node16
docker run --rm -it docker.io/thecodingmachine/php:8.0-v4-fpm-node16 node -v
# Should return v16.16.0

Node variants for fpm and cli was forgot during the hotfixing. It's fixed.

defser commented 2 years ago

@mistraloz thank you