From 454b5504a81bc01d1eae6e4843b03eef1f380b04 Mon Sep 17 00:00:00 2001 From: pierallard Date: Thu, 13 Jan 2022 15:35:23 +0100 Subject: [PATCH 1/2] Add node 16 and yarn 3 image --- README.md | 16 ++++++++------ node/16/Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 node/16/Dockerfile diff --git a/README.md b/README.md index ce67c13..22c5273 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This repository contains Dockerfiles to be used for [Akeneo PIM](https://www.ake - [**akeneo/php**](https://hub.docker.com/r/akeneo/php): An image with PHP CLI preconfigured, based on `debian:jessie-slim` or `debian:stretch-slim`. This image is used to run command line PHP scripts. - [**akeneo/fpm**](https://hub.docker.com/r/akeneo/fpm): An image with PHP FPM preconfigured, to be used with any PHP project, based on `akeneo/php` (needs to be run along `nginx` or `httpd`). This image is to be used with Apache to serve the PIM. -- [**akeneo/node**](https://hub.docker.com/r/akeneo/node): An image with Chromium and Puppeteer, used to run the front-end tests of the PIM. +- [**akeneo/node**](https://hub.docker.com/r/akeneo/node): An image with Node, Yarn, Chromium and Puppeteer, used to build front and run the front-end tests of the PIM. All PHP and FPM images are available as follow: @@ -21,17 +21,19 @@ All PHP and FPM images are available as follow: | 7.3 | Debian 9 "Stretch" with packages coming from [Ondřej Surý repository](https://deb.sury.org/) | akeneo/php:7.3 | | | | akeneo/fpm:php-7.3 | -And for Node images: - -| Node version | Based on | Corresponding tags | -|--------------|--------------------------------------|--------------------| -| 10 | Official Docker image `node:10-slim` | akeneo/node:10 | - For all images, tag `latest` is identical to the one corresponding to the most recent language version. Akeneo 3.x is to be used only with PHP 7.2 (or higher), with php-fpm and Apache 2.4 with FCGI. Akeneo 4.0 comes with its own Docker images and does not use this repository anymore. +And for Node images: + +| Node version | Yarn version | Based on | Corresponding tags | +|--------------|--------------|--------------------------------------------|--------------------| +| 10 | 1.13 | Official Docker image `debian:buster-slim` | akeneo/node:10 | +| 12 | 1.22 | Official Docker image `debian:buster-slim` | akeneo/node:12 | +| 16 | 3.1 | Official Docker image `debian:buster-slim` | akeneo/node:16 | + ## How to use these images If you are new to Docker, please start with the [getting started section](https://github.com/akeneo/Dockerfiles/blob/master/Docs/getting-started.md). diff --git a/node/16/Dockerfile b/node/16/Dockerfile new file mode 100644 index 0000000..2cc0d51 --- /dev/null +++ b/node/16/Dockerfile @@ -0,0 +1,54 @@ +FROM debian:buster-slim +MAINTAINER Damien Carcel + +RUN groupadd --gid 1000 node \ + && useradd --uid 1000 --gid node --shell /bin/bash --create-home node + +RUN echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/path_exclusions && \ + echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/path_exclusions && \ + apt-get update && \ + apt-get --no-install-recommends --no-install-suggests -y -q install \ + wget apt-transport-https ca-certificates gnupg && \ + apt-get clean && apt-get --yes --quiet autoremove --purge && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# NodeJS v16 and Yarn 3 +RUN sh -c 'wget -q -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key add -' && \ + sh -c 'echo "deb https://deb.nodesource.com/node_16.x buster main" > /etc/apt/sources.list.d/nodesource.list' && \ + sh -c 'echo "deb-src https://deb.nodesource.com/node_16.x buster main" >> /etc/apt/sources.list.d/nodesource.list' && \ + apt-get update && \ + apt-get install -y nodejs && \ + corepack enable && \ + yarn set version stable && \ + apt-get clean && apt-get -y -q autoremove --purge && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others). +# Note: this installs the necessary libs to make work the bundled version of Chromium that Puppeteer installs. +# +# Puppeter is installed as a JS dependency in the PIM. It is not needed directly in the image. +# @see https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker +RUN apt-get update \ + && apt-get --no-install-recommends --no-install-suggests -y -q install \ + ca-certificates fonts-liberation gconf-service gnupg libasound2 libatk1.0-0 libcairo2 libcups2 \ + libdbus-1-3 libexpat1 libfontconfig1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \ + libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ + libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ + libappindicator1 libnss3 lsb-release wget xdg-utils \ + && wget https://dl-ssl.google.com/linux/linux_signing_key.pub \ + && apt-key add linux_signing_key.pub \ + && rm linux_signing_key.pub \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get --no-install-recommends --no-install-suggests --yes --quiet install \ + google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \ + && apt-get clean && apt-get --yes --quiet autoremove --purge \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# It's a good idea to use dumb-init to help prevent zombie chrome processes. +ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 /usr/local/bin/dumb-init +RUN chmod +x /usr/local/bin/dumb-init + +USER node + +ENTRYPOINT ["dumb-init", "--"] From c15ed972cdc83790a53a83ae9fc9a933e24c8a91 Mon Sep 17 00:00:00 2001 From: pierallard Date: Tue, 25 Jan 2022 15:47:11 +0100 Subject: [PATCH 2/2] Remove corepack from node 16 --- node/16/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/16/Dockerfile b/node/16/Dockerfile index 2cc0d51..5a3a97a 100644 --- a/node/16/Dockerfile +++ b/node/16/Dockerfile @@ -18,8 +18,8 @@ RUN sh -c 'wget -q -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | A sh -c 'echo "deb-src https://deb.nodesource.com/node_16.x buster main" >> /etc/apt/sources.list.d/nodesource.list' && \ apt-get update && \ apt-get install -y nodejs && \ - corepack enable && \ - yarn set version stable && \ + npm i -g yarn && \ + yarn set version 3.1.1 && \ apt-get clean && apt-get -y -q autoremove --purge && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*