-
Notifications
You must be signed in to change notification settings - Fork 19
fix: copy node from alpine image #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,45 +1,42 @@ | ||||||||||||||||||||
| ARG NODE_VERSION=22 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| FROM node:${NODE_VERSION}-alpine AS node | ||||||||||||||||||||
|
|
||||||||||||||||||||
| FROM base | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ARG NODE_VERSION=22 | ||||||||||||||||||||
| ARG NODE_VERSION | ||||||||||||||||||||
|
|
||||||||||||||||||||
| USER root | ||||||||||||||||||||
|
|
||||||||||||||||||||
| COPY --link --from=node /usr/local/bin/node /usr/local/bin/node | ||||||||||||||||||||
| COPY --link --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules | ||||||||||||||||||||
|
|
||||||||||||||||||||
| RUN <<EOF | ||||||||||||||||||||
| set -e | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if [[ "$NODE_VERSION" == "24" ]]; then | ||||||||||||||||||||
| apk add \ | ||||||||||||||||||||
| --no-cache \ | ||||||||||||||||||||
| --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||||||||||||||||||||
| nodejs-current npm | ||||||||||||||||||||
| else | ||||||||||||||||||||
| apk add \ | ||||||||||||||||||||
| --no-cache \ | ||||||||||||||||||||
| --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||||||||||||||||||||
| nodejs npm | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm | ||||||||||||||||||||
| ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx | ||||||||||||||||||||
| ln -s /usr/local/lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack | ||||||||||||||||||||
|
|
||||||||||||||||||||
| apk add --no-cache npm bash git shadow patch coreutils | ||||||||||||||||||||
|
|
||||||||||||||||||||
| PHP_VERSION_ID=$(php -r 'echo PHP_VERSION_ID;') | ||||||||||||||||||||
| if [[ "$PHP_VERSION_ID" -lt 80500 ]]; then | ||||||||||||||||||||
| install-php-extensions tideways blackfire xdebug | ||||||||||||||||||||
| fi | ||||||||||||||||||||
|
|
||||||||||||||||||||
| cd /usr/local/etc/php/conf.d | ||||||||||||||||||||
| mv docker-php-ext-opentelemetry.ini docker-php-ext-opentelemetry.disabled | ||||||||||||||||||||
| if [[ "$PHP_VERSION_ID" -lt 80500 ]]; then | ||||||||||||||||||||
| mv docker-php-ext-xdebug.ini docker-php-ext-xdebug.disabled | ||||||||||||||||||||
| mv docker-php-ext-tideways.ini docker-php-ext-tideways.disabled | ||||||||||||||||||||
| mv docker-php-ext-blackfire.ini docker-php-ext-blackfire.disabled | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| node --version | ||||||||||||||||||||
| npm --version | ||||||||||||||||||||
|
|
||||||||||||||||||||
| INSTALLED_NODE_VERSION=$(node -e "console.log(process.versions.node.substr(0,2))") | ||||||||||||||||||||
| if [[ "$INSTALLED_NODE_VERSION" != "$NODE_VERSION" ]]; then | ||||||||||||||||||||
| echo "ERROR: Installed Node.js version ($INSTALLED_NODE_VERSION) does not match expected version ($NODE_VERSION)" | ||||||||||||||||||||
| exit 1 | ||||||||||||||||||||
| fi | ||||||||||||||||||||
|
|
||||||||||||||||||||
| apk add --no-cache bash git shadow patch coreutils | ||||||||||||||||||||
|
|
||||||||||||||||||||
| install-php-extensions tideways blackfire xdebug/[email protected] | ||||||||||||||||||||
|
||||||||||||||||||||
| install-php-extensions tideways blackfire xdebug/[email protected] | |
| PHP_VERSION_ID=$(php -r 'echo PHP_VERSION_ID;') | |
| if [[ "$PHP_VERSION_ID" -lt 80500 ]]; then | |
| install-php-extensions tideways blackfire xdebug/[email protected] | |
| fi |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extension disabling logic now unconditionally disables all extensions. The old code only disabled xdebug, tideways, and blackfire extensions for PHP versions below 8.5.0. Now these extensions are always disabled even after being installed. Consider wrapping these moves in a version check:
PHP_VERSION_ID=$(php -r 'echo PHP_VERSION_ID;')
if [[ "$PHP_VERSION_ID" -lt 80500 ]]; then
mv docker-php-ext-xdebug.ini docker-php-ext-xdebug.disabled
mv docker-php-ext-tideways.ini docker-php-ext-tideways.disabled
mv docker-php-ext-blackfire.ini docker-php-ext-blackfire.disabled
fi| mv docker-php-ext-xdebug.ini docker-php-ext-xdebug.disabled | |
| mv docker-php-ext-tideways.ini docker-php-ext-tideways.disabled | |
| mv docker-php-ext-blackfire.ini docker-php-ext-blackfire.disabled | |
| PHP_VERSION_ID=$(php -r 'echo PHP_VERSION_ID;') | |
| if [[ "$PHP_VERSION_ID" -lt 80500 ]]; then | |
| mv docker-php-ext-xdebug.ini docker-php-ext-xdebug.disabled | |
| mv docker-php-ext-tideways.ini docker-php-ext-tideways.disabled | |
| mv docker-php-ext-blackfire.ini docker-php-ext-blackfire.disabled | |
| fi |
Uh oh!
There was an error while loading. Please reload this page.