Docker Community Forums

Share and learn in the Docker community.

Create own Docker image

I have compiled a customized nodejs version on my ubuntu server 18.04 using the description here: node/BUILDING.md at master · nodejs/node · GitHub

I wonder if I can create a customized docker image based on the self compiled nodejs? Since the docker image of nodejs from the public repository is with the official nodejs version, it does not suit my need.

Really grateful if I could get some guideline about packing my own nodejs docker image.

Thanks in advance.

Hi

Sure you can, if you know which commands to execute, just put those in a dockerfile and build it

Hi

I mean like for the Dockerfile. I pack for example
FROM node:9.0.0 but the 9.0.0 is the official nodejs 9.0.0. I have compiled one by changing the source code of nodejs. How can I pack one docker image with my compiled nodejs?

You could just FROM debian (fx) and just apt-get install your stuff or whatever you need to compile your own.
The node image is just everything you need to get started with node, but if you need your own version, you need to start from a other simple base image where you can install what you need, debian/ubuntu/centos/alpine

@terpz I see. Thanks. So I just need to install a ubuntu16.04 image from Docker Hub and customize everything I want by using Dockerfile and build.

Correct :slight_smile:

FROM ubuntu:16.04
RUN apt-get update && apt-get -y install ....

``´
1 Like