How to use node LTS version in alpine:3.17 image? - node.js

I'm using alpine 3.14 docker image. In the release info it is said, there is node LTS (18) and current (19) included.
How do I use the LTS version of node, which is 18.20?
FROM alpine:3.17#sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c
RUN apk --update add bash curl git npm
Using this container, the current node version is used.

The Alpine OS distribution is different from the Alpine docker containers. The alpine container images do not include node. In fact, most of the packages listed on the page you link are not included.
If you want an alpine 3.17 container image that includes the current LTS version of node, you can use node:lts-alpine3.17.

Related

/lib64/ld-linux-x86-64.so.2: No such file or directory error

Background
I am using docker to do a school project. Specifically, I pulled an ubuntu image and here is the system config:
I then logged into the docker container (ubuntu) and set up elasticsearch. When I try to run
./bin/elasticsearch
I get the following error inside the docker container's terminal
/lib64/ld-linux-x86-64.so.2: No such file or directory
I have two main confusions:
what does that even mean?
How to solve it?
If you are running this on an M1 macbook, it's possible that you are running a native Arm image of ubuntu, instead of the emulated x86 image. If the elasticsearch distribution you are trying to install is for x86_64, then it attempts to link to the x86-64-native ld.so, which of course isn't present on different platforms.
Either install the package for the arm platform specifically if they provide one, or - more likely - run docker explicitly as the emulated x86_64 platform:
docker run --platform linux/x86_64 <image>
For docker-compose, add platform: linux/x86_64 according to the docs
services:
my-app:
platform: linux/x86_64
No idea what you are running in your container but for me, the reason was simply because a package (Prisma https://github.com/prisma/prisma/issues/8478#) did not find openssl packages and installing them on alpine image failed even with openssl manually installed.
It was fixed by switching to slim image and installing openssl with apt-get update && apt-get -y install openssl. I highly recommend not changing your platform since with my M1 the build time increased by 200s using linux/x86_64.
Completing #misnomer answer, I could not even build the image.
If that is the case just add FROM --platform=linux/x86_64 ..., from this source. Ex: FROM --platform=linux/x86_64 python:slim ...

Which Operating System is Docker virtualizing when it runs the Node image?

When you use the Node Docker Image, i suppose that Docker is running or (virtualizing) a OS that has a node installation, I will like to know what is that OS, or how is posible that Docker is able to run NodeJs
There are several different image variants for Node - the official builds are all either flavors of Debian or Alpine Linux.
See more information: https://github.com/nodejs/docker-node/blob/main/README.md#image-variants
node:<version>
Debian
node:alpine
Alpine
node:buster
Debian 10
node:stretch
Debian 9
node:slim
Debian minimal

nodejs v13.10.1 install on alpine

I'm trying to install nodejs version 13.10.1 on alpine docker.
What I'm trying:
FROM python:2.7-alpine
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
But of course It's installed the current version in edge (where it isn't v13.10.1).
So how can I found and install nodejs v13.10.1 on alpine docker?
it doesn't look like there is a package nodejs-current version 13.10.1 at branch edge in community or main. see: https://pkgs.alpinelinux.org/packages?name=nodejs-current&branch=edge&repo=community
you can build your own version - see https://stackoverflow.com/a/53389225/2087704
you could use the specific image FROM node:13.10.1-alpine

Fabric Docker image version of 1.1.0-alpha does not match this newer version of BYFN and is unsupport

Fabric Docker image version of 1.1.0-alpha does not match this newer version of BYFN and is unsupport. Either move to a later version of Fabric or checkout an earlier version of fabric-samples.
Local fabric binaries and docker images are
out of sync. This may cause problems.
enter image description here
is their any terminal commands in Ubuntu 16.04 LTS to solve this problem?
Upgrade your local environment by running
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0
Go to the fabric-samples folder, check the git branch by:
git branch
Just try to change to another branch and try, for example, using Fabric 1.0 :

Which linux official distribution are less than 100mb?

I need some Linux official distribution that are less than 100mb for pulling images from docker hub server.
so far I am familiar with debian and busybox. any more official suggestions?
Generally speaking a small linux image with docker, alpine linux is commonly used. The size of alpine linux is only 4MB. You can easily add packages as you need with apk command.
https://hub.docker.com/_/alpine/
$ docker pull alpine
$ docker images | grep alpine
alpine latest 4a415e366388 8 days ago 3.99 MB

Resources