I am writing a Dockerfile to dockerize a php + nodejs app. so I start from php:7.2.13-fpm-alpine image which is based on alpine:3.8. As study I found that I can add latest alpine repositoriy by command
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.10/main/ nodejs
However, with this command, I only got nodejs v10.16.3 while I want a latest one(v13.0.1) Is it possible to achieve it?
Alpine nodejs has two repositories for one LTS and one for the current version.
No, it doesn't come with npm.
(Background: At the time of writing, node:14-alpine is 14.17. 1 , whereas the latest minor Node. js version of 14 is 14.17.
Alpine nodejs has two repositories for one LTS and one for the current version.
Nodejs LTS:
Package nodejs
Version 12.13.0-r1
Description JavaScript runtime built on V8 engine - LTS version
Project https://nodejs.org/
nodejs-current:
Package nodejs-current
Version 13.0.1-r0
Description JavaScript runtime built on V8 engine - current stable version
Project https://nodejs.org/
If you need current version then you have use nodejs-current
FROM alpine:3.8
ENV ALPINE_MIRROR "http://dl-cdn.alpinelinux.org/alpine"
RUN echo "${ALPINE_MIRROR}/edge/main" >> /etc/apk/repositories
RUN apk add --no-cache nodejs-current --repository="http://dl-cdn.alpinelinux.org/alpine/edge/community"
RUN node --version
you can use the follwoing:
FROM alpine:3.8
RUN apk update && apk add --no-cache wget
RUN wget https://nodejs.org/dist/v13.0.1/node-v13.0.1-linux-x64.tar.xz && tar -xf node-v13.0.1-linux-x64.tar.xz
then you will has it in working directory in node-v13.0.1-linux-x64
folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With