Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker file FROM node:12.2.0-alpine

Hi I am new to the Docker and node. I want to know what does this line means?

FROM node:12.2.0-alpine

What the relationship between node and alpine?

And what if I want to use the newest version of node, what should I change?

Thank you so much!

like image 299
lllllll Avatar asked Mar 22 '20 06:03

lllllll


People also ask

What is the node 12 alpine image?

Alpine is the base image which is based on Alpine Linux, a very compact Linux distribution. So, node:12.2. 0-alpine is a Alpine Linux image with node 12.2. 0 installed. For the latest Alpine based image you can simply do node:alpine .

How do I specify node in Dockerfile?

Outside of a container, this is simple. You install the Node version that you want (use nvm to easily swap between them) and then specify npm version. Doing this inside a container, while possible, is a little bit trickier. You declare the version of Node you want to use with the “FROM” command.

Does alpine image have node?

node:<version>-alpine This image is based on the popular Alpine Linux project, available in the alpine official image.

Should I use node alpine?

So to wrap up, generally it's a good idea to opt for node alpine unless you have a complicated setup and the official node image makes things easier for you. Almost all the node containers I have worked with, 90% of them run on alpine image. Save this answer. Show activity on this post.


1 Answers

Alpine is the base image which is based on Alpine Linux, a very compact Linux distribution. So, node:12.2.0-alpine is a Alpine Linux image with node 12.2.0 installed.

For the latest Alpine based image you can simply do node:alpine. If you want latest but not specifically Alpine you can do node:latest, that image will be based on stretch which is a Debian distribution.

You can find a full list of all supported tags here: https://hub.docker.com/_/node/

like image 73
Ganhammar Avatar answered Oct 23 '22 18:10

Ganhammar