docker-node icon indicating copy to clipboard operation
docker-node copied to clipboard

Node 6 based on Alpine 3.7?

Open mlowicki opened this issue 8 years ago • 22 comments

Currently it's based on Alpine 3.4 and support for it already ended - https://wiki.alpinelinux.org/wiki/Alpine_Linux:Releases. Maybe we could use Alpine 3.7?

mlowicki avatar Jun 15 '18 09:06 mlowicki

Node 6 is going to get Alpine 3.7 on the next non security update. Alpine and Yarn versions are pinned and only change on update.

LaurentGoderre avatar Jun 15 '18 12:06 LaurentGoderre

Any clue when non-security update to Node 6 will be released?

mlowicki avatar Jun 15 '18 13:06 mlowicki

Unfortunately I don't.

LaurentGoderre avatar Jun 15 '18 14:06 LaurentGoderre

From what I see latest releases was on 2018-06-12 (3 days ago, https://nodejs.org/en/download/releases/) - 6.14.3 and it still uses alpine:3.4 (https://github.com/nodejs/docker-node/blob/e3ec2111af089e31321e76641697e154b3b6a6c3/6/alpine/Dockerfile#L1).

mlowicki avatar Jun 15 '18 16:06 mlowicki

That was a security update https://nodejs.org/en/blog/vulnerability/june-2018-security-releases/

nschonni avatar Jun 15 '18 16:06 nschonni

Is this also true for node 8? Do you have a timeline for when the next non-security update would be?

The issue is that alpine 3.6 has multiple open vulnerabilities on packages. Upgrading to 3.7 would remove these .. so while this is not a node security update, it is a security update.

tecnobrat avatar Jun 18 '18 14:06 tecnobrat

It's true of all versions.

LaurentGoderre avatar Jun 18 '18 15:06 LaurentGoderre

It is unlikely that node 6 will run Alpine 3.7 because it's in maintenance mode.

LaurentGoderre avatar Jul 06 '18 16:07 LaurentGoderre

Pull request that updates the Node 6, 8, and 10 Docker images: https://github.com/nodejs/docker-node/pull/811.

If this patch set cannot be merged in, then I suggest as an alternative creating Alpine images with the Alpine version number (like node:6-alpine3.8)

Brian

masneyb avatar Jul 09 '18 14:07 masneyb

We can't do multiple alpine variants because of how long it takes to build each alpine image. Adding variants for 3.8 would increase the builds times significantly.

chorrell avatar Jul 09 '18 14:07 chorrell

@chorrell @masneyb we have a micro service running on boron-alpine (alpine-3.4) in Kubernetes and we see that its vulnerable in production environment. what is the fix you suggest here ?

Mohammeds-Macbook-Pro:k8s Omar$ docker exec -it 995 sh /opt/ibm/app $ cat /etc/issue Welcome to Alpine Linux 3.4 Kernel \r on an \m (\l)

/opt/ibm/app # curl --version curl 7.59.0 (x86_64-alpine-linux-musl) libcurl/7.59.0 OpenSSL/1.0.2n zlib/1.2.11 libssh2/1.7.0

Vulnerable Packages Found

CVE-2018-1000300

Policy Status Active

Summary curl version curl 7.54.1 to and including curl 7.59.0 contains a CWE-122: Heap-based Buffer Overflow vulnerability in denial of service and more that can result in curl might overflow a heap based memory buffer when closing down an FTP connection with very long server command replies.. This vulnerability appears to have been fixed in curl < 7.54.1 and curl >= 7.60.0. curl version curl 7.20.0 to and including curl 7.59.0 contains a CWE-126: Buffer Over-read vulnerability in denial of service that can result in curl can be tricked into reading data beyond the end of a heap based buffer used to store downloaded RTSP content.. This vulnerability appears to have been fixed in curl < 7.20.0 and curl >= 7.60.0.

Vendor Security Notice IDs Official Notice
ALPINE-CVE-2018-1000300

Affected Packages Policy Status How to Resolve Security Notice
curl Active Upgrade curl to >= 7.60.0-r0 ALPINE-CVE-2018-1000300

CVE-2018-1000301

Policy Status Active

Summary curl version curl 7.54.1 to and including curl 7.59.0 contains a CWE-122: Heap-based Buffer Overflow vulnerability in denial of service and more that can result in curl might overflow a heap based memory buffer when closing down an FTP connection with very long server command replies.. This vulnerability appears to have been fixed in curl < 7.54.1 and curl >= 7.60.0. curl version curl 7.20.0 to and including curl 7.59.0 contains a CWE-126: Buffer Over-read vulnerability in denial of service that can result in curl can be tricked into reading data beyond the end of a heap based buffer used to store downloaded RTSP content.. This vulnerability appears to have been fixed in curl < 7.20.0 and curl >= 7.60.0.

Vendor Security Notice IDs Official Notice
ALPINE-CVE-2018-1000301

Affected Packages Policy Status How to Resolve Security Notice
curl Active Upgrade curl to >= 7.60.0-r0 ALPINE-CVE-2018-1000301

OK

mohaomar avatar Jul 18 '18 08:07 mohaomar

If switching to 8-alpine or 10-alpine is an option, that would get you a newer version of alpine that is still receiving updates. Also the EOL date for Node v6 is April 2019, so you'll need to upgrade eventually anyway. v10 would be better since the EOL date is April 2021

chorrell avatar Jul 18 '18 13:07 chorrell

For now we've ended up with:

FROM node:6.14.3-alpine as node

FROM alpine:3.8

COPY --from=node /usr/local /usr/local

ENV GRAPHITE_HOST=localhost\
    PORT0=8125\
    STATSD_USER=statsd

RUN set -eux \
 && apk --update --no-cache add \
    dumb-init \
    libstdc++ \
 && npm install [email protected] \
 && npm cache clear --force \
 && adduser -S $STATSD_USER

COPY config.js /etc/statsd.js

EXPOSE 8125/udp 8130
USER $STATSD_USER

ENTRYPOINT ["dumb-init"]
CMD ["/node_modules/statsd/bin/statsd", "/etc/statsd.js"]

to have Node.js on Alpine 3.8 which is used to have StatsD.

mlowicki avatar Jul 20 '18 13:07 mlowicki

Very clever!! It works fine?

LaurentGoderre avatar Jul 20 '18 14:07 LaurentGoderre

yes, works fine.

mlowicki avatar Jul 20 '18 16:07 mlowicki

@chorrell I wonder if we could document this as a workaround for alpine versions?

LaurentGoderre avatar Jul 20 '18 17:07 LaurentGoderre

@mlowicki cool! I also copied /opt directory because I need yarn.

beebird avatar Aug 23 '18 07:08 beebird

A1) Regarding this hack, which looks clever https://github.com/nodejs/docker-node/issues/789#issuecomment-406594229, I get this error (full Travis log):

Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/bin/node)

A1) The good news is that I built the node image 8.11.4 using alpine:3.8 and it works perfectly.

B) Proposal: I think the 'Docker Hub Node' project could use the same syntax as the 'Docker Hub Python' project where the core OS image have different versions.

screen shot 2018-08-29 at 11 27 45 am

pascalandy avatar Aug 29 '18 15:08 pascalandy

It has been proposed before. The blocker is build time. Compiling Node in alpine takes 40 minutes so supporting multiple versions would make the build way too long.

LaurentGoderre avatar Aug 30 '18 12:08 LaurentGoderre

@LaurentGoderre OK, I wasn't aware that this was a challenge. Do I understand that building all nodes images via Travis would take more than 24 hours?

pascalandy avatar Aug 30 '18 12:08 pascalandy