Nitzy
Nitzy

Reputation: 260

Understanding of docker FILE

I am using nodejs 11 with alpine on my servers using FROM node:11-alpine line. so by this, i understand it uses nodejs 11 version but what about alpine version? I checked manually on the server it uses alpine version 3.9 but what if I want to change the alpine version number?

One solution I know, buy creating own layer like

FROM alpine:{version}

ENV NODE_VERSION 11

then installing nodejs

I just want to understand can I do it bypassing the version number of alpine too in FROM node:11-alpine

Upvotes: 0

Views: 95

Answers (1)

jens
jens

Reputation: 2145

When you type FROM in a docker file it will look for an image with that name. Images can contain any configuration that anyone wants to include and it can be named however they want.

That being said there are many node images. https://hub.docker.com/_/node

On this page there are many images of node on different versions of alpine. If you can’t find the image you want there then you might need to create your own configuration as you suggested. You could make a node alpine base image yourself that you base all your app images off of.

I hope you find what you are looking for. I tend to build my image off debian and install the version of node that I want for that project. I have example of that at https://github.com/jensen/assistbot/blob/master/Dockerfile

Upvotes: 1

Related Questions