Explorar el Código

Install of libpng16 library for fix react and react with material-ui application (#1625)

* Added commands in Workspace Dockerfile for installation of libpng with configurable env argument switch

* Updated documentation
Emanuele Menon hace 6 años
padre
commit
dcf6b6d9ac
Se han modificado 4 ficheros con 40 adiciones y 0 borrados
  1. 27 0
      DOCUMENTATION/content/documentation/index.md
  2. 1 0
      docker-compose.yml
  3. 1 0
      env-example
  4. 11 0
      workspace/Dockerfile

+ 27 - 0
DOCUMENTATION/content/documentation/index.md

@@ -1683,3 +1683,30 @@ Example:
 WORKSPACE_NPM_REGISTRY=https://registry.npm.taobao.org
 WORKSPACE_COMPOSER_REPO_PACKAGIST=https://packagist.phpcomposer.com
 ```
+
+<br>
+
+## I get `Module build failed: Error: write EPIPE` while compiling react application
+
+When you run `npm build` or `yarn dev` building a react application using webpack with elixir you may receive a `Error: write EPIPE` while processing .jpg images.
+
+This is caused of an outdated library for processing **.jpg files** in ubuntu 16.04.
+
+To fix the problem you can follow those steps
+
+1 - Open the `.env`.
+
+2 - Search for `WORKSPACE_INSTALL_LIBPNG` or add the key if missing.
+
+3 - Set the value to true:
+
+```dotenv
+WORKSPACE_INSTALL_LIBPNG=true
+```
+
+4 - Finally rebuild the workspace image
+
+```bash
+docker-compose build workspace
+```
+

+ 1 - 0
docker-compose.yml

@@ -86,6 +86,7 @@ services:
           - INSTALL_DUSK_DEPS=${WORKSPACE_INSTALL_DUSK_DEPS}
           - INSTALL_PG_CLIENT=${WORKSPACE_INSTALL_PG_CLIENT}
           - INSTALL_SWOOLE=${WORKSPACE_INSTALL_SWOOLE}
+          - INSTALL_LIBPNG=${WORKSPACE_INSTALL_LIBPNG}
           - PUID=${WORKSPACE_PUID}
           - PGID=${WORKSPACE_PGID}
           - CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION}

+ 1 - 0
env-example

@@ -112,6 +112,7 @@ WORKSPACE_INSTALL_TERRAFORM=false
 WORKSPACE_INSTALL_DUSK_DEPS=false
 WORKSPACE_INSTALL_PG_CLIENT=false
 WORKSPACE_INSTALL_SWOOLE=false
+WORKSPACE_INSTALL_LIBPNG=false
 WORKSPACE_PUID=1000
 WORKSPACE_PGID=1000
 WORKSPACE_CHROME_DRIVER_VERSION=2.32

+ 11 - 0
workspace/Dockerfile

@@ -352,6 +352,17 @@ RUN if [ ${INSTALL_SWOOLE} = true ]; then \
     ln -s /etc/php/${PHP_VERSION}/mods-available/swoole.ini /etc/php/${PHP_VERSION}/cli/conf.d/20-swoole.ini \
 ;fi
 
+###########################################################################
+# Libpng16 EXTENSION
+###########################################################################
+
+ARG INSTALL_LIBPNG=false
+
+RUN if [ ${INSTALL_LIBPNG} = true ]; then \
+    apt update && \
+    apt install libpng16-16 \
+;fi
+
 ###########################################################################
 # Drupal Console:
 ###########################################################################