Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Adds a new Docker image with node:16 and yarn:3.1.1 #362

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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).
Expand Down
54 changes: 54 additions & 0 deletions node/16/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM debian:buster-slim
MAINTAINER Damien Carcel <[email protected]>

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 && \
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/*

# 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", "--"]