Alpine-Linux-based, tiny Docker-container for NodeJS. This is really small image compare around 60MB of this container with typical 500MB to 800MB sizes you get with Ubuntu- or CentOS-based images.
Insert at the top of your Dockerfile:
FROM aliengreenllc/node-alpine:current-alpine3.18
To see all supported versions: https://hub.docker.com/r/aliengreenllc/node-alpine/tags/
If you need more packages installed (e.g. make, gcc for compiling some native Node modules, or imagemagick etc.) base your new container on this one and you can use apk package manager that Alpine provides. For instance:
RUN apk search --update imagemagickor:
RUN add --update make gcc g++ python linux-headerContainer needs periodic maintenance to update Alpine Linux or NodeJS. For that we need to make changes in the Dockerfile for a specific version of Alpine Linux or NodeJS. The script also builds Docker image by given tag. So, follow the release.sh script steps.
- Alpine Linux-NodeJS update - We are using
release.shscript by invoking termninal command:
$ ./release.sh --tag current-alpine3.18Where
current-alpine3.18is a NodeJS Docker official image tag name.
If command execution is done without errors you can see new tag: current-alpine3.18, by running command git tag
Note: The
release.shscript first removes old tag from GitHub and then recreates new one. So, if the tag with above name already exist it will be removed, but it OK, don't panic.
If you need fast search for official NodeJS tag you can invoke release.sh script with specific argument:
$ ./release.sh --search current-Tag names organised as follows: first number current is a NodeJS version number and last 3.18 is Alpine-Linux version number.
$ docker build -t aliengreenllc/node-alpine:current-alpine3.18 .
$ docker run -t aliengreenllc/node-alpine:current-alpine3.18
$ docker push aliengreenllc/node-alpine:current-alpine3.18
$ docker compose up -d --force-recreate --no-deps name
$ docker exec -it name sh
$ docker compose logs -f name
$ docker history name