jellyfin / jellyfin-vue

A modern web client for Jellyfin based on Vue
https://jellyfin.org
GNU General Public License v3.0
1.26k stars 226 forks source link

Building error on arm64 machine #1610

Closed martadinata666 closed 2 years ago

martadinata666 commented 2 years ago

Description of the bug

Error installing node deps opting-bin

dedyms@rpi4 jellyfin-vue % docker build -t jellyfin-vue:local -f Dockerfile.ssr .
Sending build context to Docker daemon  3.913MB
Step 1/15 : FROM node:16-alpine AS build
 ---> 8074a83d0ba9
Step 2/15 : WORKDIR /app
 ---> Using cache
 ---> 633ca21c678c
Step 3/15 : RUN apk add --no-cache --virtual .build-deps git python3 make automake autoconf g++ libpng-dev libtool nasm file
 ---> Running in 19dd676b7a96
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz
(1/48) Installing ca-certificates (20191127-r5)
(2/48) Installing brotli-libs (1.0.9-r5)
(3/48) Installing nghttp2-libs (1.43.0-r0)
(4/48) Installing libcurl (7.79.1-r0)
(5/48) Installing expat (2.4.1-r0)
(6/48) Installing pcre2 (10.36-r0)
(7/48) Installing git (2.32.0-r0)
(8/48) Installing libbz2 (1.0.8-r1)
(9/48) Installing libffi (3.3-r2)
(10/48) Installing gdbm (1.19-r0)
(11/48) Installing xz-libs (5.2.5-r0)
(12/48) Installing mpdecimal (2.5.1-r1)
(13/48) Installing ncurses-terminfo-base (6.2_p20210612-r0)
(14/48) Installing ncurses-libs (6.2_p20210612-r0)
(15/48) Installing readline (8.1.0-r0)
(16/48) Installing sqlite-libs (3.35.5-r0)
(17/48) Installing python3 (3.9.5-r2)
(18/48) Installing make (4.3-r0)
(19/48) Installing perl (5.32.1-r0)
(20/48) Installing perl-error (0.17029-r1)
(21/48) Installing perl-git (2.32.0-r0)
(22/48) Installing git-perl (2.32.0-r0)
(23/48) Installing automake (1.16.3-r0)
(24/48) Installing m4 (1.4.18-r2)
(25/48) Installing autoconf (2.71-r0)
(26/48) Installing binutils (2.35.2-r2)
(27/48) Installing libgomp (10.3.1_git20210424-r2)
(28/48) Installing libatomic (10.3.1_git20210424-r2)
(29/48) Installing libgphobos (10.3.1_git20210424-r2)
(30/48) Installing gmp (6.2.1-r0)
(31/48) Installing isl22 (0.22-r0)
(32/48) Installing mpfr4 (4.1.0-r0)
(33/48) Installing mpc1 (1.2.1-r0)
(34/48) Installing gcc (10.3.1_git20210424-r2)
(35/48) Installing musl-dev (1.2.2-r3)
(36/48) Installing libc-dev (0.7.2-r3)
(37/48) Installing g++ (10.3.1_git20210424-r2)
(38/48) Installing libpng (1.6.37-r1)
(39/48) Installing pkgconf (1.7.4-r0)
(40/48) Installing zlib-dev (1.2.11-r3)
(41/48) Installing libpng-dev (1.6.37-r1)
(42/48) Installing bash (5.1.4-r0)
Executing bash-5.1.4-r0.post-install
(43/48) Installing libltdl (2.4.6-r7)
(44/48) Installing libtool (2.4.6-r7)
(45/48) Installing nasm (2.15.05-r0)
(46/48) Installing libmagic (5.40-r1)
(47/48) Installing file (5.40-r1)
(48/48) Installing .build-deps (20211204.060115)
Executing busybox-1.33.1-r6.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 304 MiB in 64 packages
Removing intermediate container 19dd676b7a96
 ---> 41e0864bf5c4
Step 4/15 : COPY . .
 ---> 3e7cafff300b
Step 5/15 : RUN npm ci --no-audit
 ---> Running in 002af559c375
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @types/anymatch@3.0.0: This is a stub types definition. anymatch provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/browserslist@4.15.0: This is a stub types definition. browserslist provides its own type definitions, so you do not need this installed.
npm WARN deprecated @stylelint/postcss-markdown@0.36.2: Use the original unforked package instead: postcss-markdown
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm notice 
npm notice New minor version of npm available! 8.1.2 -> 8.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.2.0>
npm notice Run `npm install -g npm@8.2.0` to update!
npm notice 
npm ERR! code 1
npm ERR! path /app/node_modules/optipng-bin
npm ERR! command failed
npm ERR! command sh -c node lib/install.js
npm ERR! compiling from source
npm ERR! spawn Unknown system error -8
npm ERR! optipng pre-build test failed
npm ERR! Error: Command failed: /bin/sh -c make install
npm ERR! pngrtran.c:99:1: warning: 'png_rtran_ok' defined but not used [-Wunused-function]
npm ERR!    99 | png_rtran_ok(png_structrp png_ptr, int need_IHDR)
npm ERR!       | ^~~~~~~~~~~~
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! pngxmem.c: In function 'pngx_malloc_rows_extended':
npm ERR! pngxmem.c:38:34: warning: comparison is always false due to limited range of data type [-Wtype-limits]
npm ERR!    38 |        (pngx_alloc_size_t)height > (pngx_alloc_size_t)(-1) / sizeof(png_bytep))
npm ERR!       |                                  ^
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: ../libpng/libpng.a(pngrutil.o): in function `png_read_filter_row':
npm ERR! pngrutil.c:(.text+0x2330): undefined reference to `png_init_filter_functions_neon'
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make[1]: *** [Makefile:100: optipng] Error 1
npm ERR! make: *** [Makefile:14: install] Error 2
npm ERR! 
npm ERR! cd src/optipng && \
npm ERR! make install && \
npm ERR! cd ../..
npm ERR! make[1]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/optipng'
npm ERR! cd ../libpng && \
npm ERR! make -f Makefile PNGLIBCONF_H_PREBUILT=pnglibconf.h.optipng && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/libpng'
npm ERR! cp pnglibconf.h.optipng pnglibconf.h
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o png.o png.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngerror.o pngerror.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngget.o pngget.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngmem.o pngmem.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngpread.o pngpread.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngread.o pngread.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrio.o pngrio.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrtran.o pngrtran.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrutil.o pngrutil.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngset.o pngset.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtrans.o pngtrans.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwio.o pngwio.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwrite.o pngwrite.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwtran.o pngwtran.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwutil.o pngwutil.c
npm ERR! ar rcs libpng.a png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
npm ERR! ranlib libpng.a
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtest.o pngtest.c
npm ERR! gcc  -L../zlib -o pngtest pngtest.o libpng.a -lz -lm
npm ERR! make[2]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/libpng'
npm ERR! cd ../opngreduc && \
npm ERR! make -f Makefile libopngreduc.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/opngreduc'
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -o opngreduc.o opngreduc.c
npm ERR! ar cru libopngreduc.a opngreduc.o
npm ERR! ranlib libopngreduc.a
npm ERR! make[2]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/opngreduc'
npm ERR! cd ../gifread && \
npm ERR! make -f Makefile libgifread.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/gifread'
npm ERR! gcc -c  -O2 -Wall -Wextra -o gifread.o gifread.c
npm ERR! ar cru libgifread.a gifread.o
npm ERR! ranlib libgifread.a
npm ERR! make[2]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/gifread'
npm ERR! cd ../pnmio && \
npm ERR! make -f Makefile libpnmio.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/pnmio'
npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmin.o pnmin.c
npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmout.o pnmout.c
npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmutil.o pnmutil.c
npm ERR! ar cru libpnmio.a pnmin.o pnmout.o pnmutil.o
npm ERR! ranlib libpnmio.a
npm ERR! make[2]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/pnmio'
npm ERR! cd ../minitiff && \
npm ERR! make -f Makefile libminitiff.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/minitiff'
npm ERR! gcc -c  -O2 -Wall -Wextra -o tiffread.o tiffread.c
npm ERR! gcc -c  -O2 -Wall -Wextra -o tiffutil.o tiffutil.c
npm ERR! ar cru libminitiff.a tiffread.o tiffutil.o 
npm ERR! ranlib libminitiff.a
npm ERR! make[2]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/minitiff'
npm ERR! cd ../pngxtern && \
npm ERR! make -f Makefile libpngxtern.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/pngxtern'
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxread.o pngxread.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrbmp.o pngxrbmp.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrgif.o pngxrgif.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrjpg.o pngxrjpg.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrpnm.o pngxrpnm.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrtif.o pngxrtif.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxio.o pngxio.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxmem.o pngxmem.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxset.o pngxset.c
npm ERR! ar cru libpngxtern.a pngxread.o pngxrbmp.o pngxrgif.o pngxrjpg.o pngxrpnm.o pngxrtif.o pngxio.o pngxmem.o pngxset.o
npm ERR! ranlib libpngxtern.a
npm ERR! make[2]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/pngxtern'
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o optipng.o optipng.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o optim.o optim.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o bitset.o bitset.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o ioutil.o ioutil.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o ratio.o ratio.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o wildargs.o wildargs.c
npm ERR! gcc -s -o optipng optipng.o optim.o bitset.o ioutil.o ratio.o wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a ../libpng/libpng.a  ../gifread/libgifread.a ../pnmio/libpnmio.a ../minitiff/libminitiff.a  -lz -lm 
npm ERR! make[1]: Leaving directory '/tmp/3b58aac6-2c70-43de-a17c-5d47f9978476/src/optipng'
npm ERR! 
npm ERR!     at /app/node_modules/bin-build/node_modules/execa/index.js:231:11
npm ERR!     at runMicrotasks (<anonymous>)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR!     at async /app/node_modules/optipng-bin/lib/install.js:17:4

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-04T06_09_48_153Z-debug.log
The command '/bin/sh -c npm ci --no-audit' returned a non-zero code: 1

Steps to reproduce

  1. Clone jellyfin-vue repo
  2. run docker build -t jellyfin-vue:local -f Dockerfile.ssr .

Expected behavior

Complete build

Logs

No response

Screenshots

No response

Platform

Linux

Browser

Other (Please specify in the "additional context" section)

Jellyfin server version

git master

Additional context

Dockerized build via Dockerfile.ssr

I see the github workflow somehow success, seems it build on amd64 and extract the artifacts `src/dist` to `multiarch` nginx? cmiiw
ferferga commented 2 years ago

Does static build fine for you?

martadinata666 commented 2 years ago

As the dependencies pretty much same, same error occurred. At npm ci --no-audit in arm64 it need rebuild the optipng-bin resulting error.

Step 5/10 : RUN npm ci --no-audit
 ---> Running in 497c13edc2e1
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @types/browserslist@4.15.0: This is a stub types definition. browserslist provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/anymatch@3.0.0: This is a stub types definition. anymatch provides its own type definitions, so you do not need this installed.
npm WARN deprecated @stylelint/postcss-markdown@0.36.2: Use the original unforked package instead: postcss-markdown
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm notice 
npm notice New minor version of npm available! 8.1.2 -> 8.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.2.0>
npm notice Run `npm install -g npm@8.2.0` to update!
npm notice 
npm ERR! code 1
npm ERR! path /app/node_modules/optipng-bin
npm ERR! command failed
npm ERR! command sh -c node lib/install.js
npm ERR! compiling from source
npm ERR! spawn Unknown system error -8
npm ERR! optipng pre-build test failed
npm ERR! Error: Command failed: /bin/sh -c make install
npm ERR! pngrtran.c:99:1: warning: 'png_rtran_ok' defined but not used [-Wunused-function]
npm ERR!    99 | png_rtran_ok(png_structrp png_ptr, int need_IHDR)
npm ERR!       | ^~~~~~~~~~~~
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! pngxmem.c: In function 'pngx_malloc_rows_extended':
npm ERR! pngxmem.c:38:34: warning: comparison is always false due to limited range of data type [-Wtype-limits]
npm ERR!    38 |        (pngx_alloc_size_t)height > (pngx_alloc_size_t)(-1) / sizeof(png_bytep))
npm ERR!       |                                  ^
npm ERR! ar: `u' modifier ignored since `D' is the default (see `U')
npm ERR! /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: ../libpng/libpng.a(pngrutil.o): in function `png_read_filter_row':
npm ERR! pngrutil.c:(.text+0x2330): undefined reference to `png_init_filter_functions_neon'
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make[1]: *** [Makefile:100: optipng] Error 1
npm ERR! make: *** [Makefile:14: install] Error 2
npm ERR! 
npm ERR! cd src/optipng && \
npm ERR! make install && \
npm ERR! cd ../..
npm ERR! make[1]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/optipng'
npm ERR! cd ../libpng && \
npm ERR! make -f Makefile PNGLIBCONF_H_PREBUILT=pnglibconf.h.optipng && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/libpng'
npm ERR! cp pnglibconf.h.optipng pnglibconf.h
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o png.o png.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngerror.o pngerror.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngget.o pngget.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngmem.o pngmem.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngpread.o pngpread.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngread.o pngread.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrio.o pngrio.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrtran.o pngrtran.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrutil.o pngrutil.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngset.o pngset.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtrans.o pngtrans.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwio.o pngwio.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwrite.o pngwrite.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwtran.o pngwtran.c
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwutil.o pngwutil.c
npm ERR! ar rcs libpng.a png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
npm ERR! ranlib libpng.a
npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtest.o pngtest.c
npm ERR! gcc  -L../zlib -o pngtest pngtest.o libpng.a -lz -lm
npm ERR! make[2]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/libpng'
npm ERR! cd ../opngreduc && \
npm ERR! make -f Makefile libopngreduc.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/opngreduc'
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -o opngreduc.o opngreduc.c
npm ERR! ar cru libopngreduc.a opngreduc.o
npm ERR! ranlib libopngreduc.a
npm ERR! make[2]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/opngreduc'
npm ERR! cd ../gifread && \
npm ERR! make -f Makefile libgifread.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/gifread'
npm ERR! gcc -c  -O2 -Wall -Wextra -o gifread.o gifread.c
npm ERR! ar cru libgifread.a gifread.o
npm ERR! ranlib libgifread.a
npm ERR! make[2]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/gifread'
npm ERR! cd ../pnmio && \
npm ERR! make -f Makefile libpnmio.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/pnmio'
npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmin.o pnmin.c
npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmout.o pnmout.c
npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmutil.o pnmutil.c
npm ERR! ar cru libpnmio.a pnmin.o pnmout.o pnmutil.o
npm ERR! ranlib libpnmio.a
npm ERR! make[2]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/pnmio'
npm ERR! cd ../minitiff && \
npm ERR! make -f Makefile libminitiff.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/minitiff'
npm ERR! gcc -c  -O2 -Wall -Wextra -o tiffread.o tiffread.c
npm ERR! gcc -c  -O2 -Wall -Wextra -o tiffutil.o tiffutil.c
npm ERR! ar cru libminitiff.a tiffread.o tiffutil.o 
npm ERR! ranlib libminitiff.a
npm ERR! make[2]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/minitiff'
npm ERR! cd ../pngxtern && \
npm ERR! make -f Makefile libpngxtern.a && \
npm ERR! cd ../optipng
npm ERR! make[2]: Entering directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/pngxtern'
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxread.o pngxread.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrbmp.o pngxrbmp.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrgif.o pngxrgif.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrjpg.o pngxrjpg.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrpnm.o pngxrpnm.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrtif.o pngxrtif.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxio.o pngxio.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxmem.o pngxmem.c
npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxset.o pngxset.c
npm ERR! ar cru libpngxtern.a pngxread.o pngxrbmp.o pngxrgif.o pngxrjpg.o pngxrpnm.o pngxrtif.o pngxio.o pngxmem.o pngxset.o
npm ERR! ranlib libpngxtern.a
npm ERR! make[2]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/pngxtern'
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o optipng.o optipng.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o optim.o optim.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o bitset.o bitset.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o ioutil.o ioutil.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o ratio.o ratio.c
npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o wildargs.o wildargs.c
npm ERR! gcc -s -o optipng optipng.o optim.o bitset.o ioutil.o ratio.o wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a ../libpng/libpng.a  ../gifread/libgifread.a ../pnmio/libpnmio.a ../minitiff/libminitiff.a  -lz -lm 
npm ERR! make[1]: Leaving directory '/tmp/aa675745-da36-4f60-9b8c-52322edbf9ce/src/optipng'
npm ERR! 
npm ERR!     at /app/node_modules/bin-build/node_modules/execa/index.js:231:11
npm ERR!     at runMicrotasks (<anonymous>)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR!     at async /app/node_modules/optipng-bin/lib/install.js:17:4

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-04T10_35_36_148Z-debug.log
The command '/bin/sh -c npm ci --no-audit' returned a non-zero code: 1
ferferga commented 2 years ago

I think we're better off removing imagemin and leave it alone, we don't really use it very much and the nuxt plugin for it seems no longer maintained.

martadinata666 commented 2 years ago

After remove imagemin deps, like linked PR above, the build success SSR type. But show some warning when npm run build

WARNING in ./node_modules/node-fetch/lib/index.js
Module not found: Error: Can't resolve 'encoding' in '/app/node_modules/node-fetch/lib'
 @ ./node_modules/node-fetch/lib/index.js
 @ ./src/.nuxt/server.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./src/.nuxt/server.js

And command npm run start:ssr seems missing when i check the package.json inside builded image

/app # cat package.json 
{
  "name": "jellyfin-vue",
  "author": "Jellyfin Team",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "nuxt-start"
  },
  "dependencies": {
    "nuxt-start": "^2.15.8"
  }
}
/app # cat nuxt.config.js 
const config = {
  server: {
    port: 80,
    host: '0.0.0.0'
  },
  telemetry: false
};

Seems package.json not copied correcly? 🤔

The static build is ok, as it using nginx to server static files.

ferferga commented 2 years ago

SSR has a different package and lockfile files as it's using only the runtime dependencies, so the docker container is not cluttered with development dependencies that are not needed at all for the end user.

Imagemin is a development dependency.

ferferga commented 2 years ago

@martadinata666 Can you verify this is fixed by #1615?

ThibaultNocchi commented 2 years ago

Which is in master :)

martadinata666 commented 2 years ago

After few builds this is the dockerfile that work.

Dockerfile.ssr

## This dockerfile builds the client entirely in a Docker context

FROM node:16-alpine AS build
# This needed to recompile the deasync deps
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY . .

# Install dependencies
RUN npm -d ci --no-audit

# Build SSR app for production in standalone mode
RUN npm -d run build:ssr:standalone

# Build final image
FROM node:16-alpine

WORKDIR /app

COPY .docker/package.json .docker/package-lock.json .docker/nuxt.config.js ./

# Copy client files from the build image
COPY --from=build /app/src/.nuxt ./.nuxt
COPY --from=build /app/src/static ./static

# Install runtime dependencies
RUN npm -d ci --production --no-audit
RUN rm -rf package-lock.json

EXPOSE 80

CMD [ "npx", "nuxt-start" ]
ferferga commented 2 years ago

So exactly the same as the one in master but without the debug output from npm.

Thank you very much for your troubleshooting. Closing this then!

martadinata666 commented 2 years ago

In master missing this part.

# This needed to recompile the deasync deps
RUN apk add --no-cache python3 make g++

Need to add to both Dockerfile.ssr and Dockerfile

ThibaultNocchi commented 2 years ago

Interesting, those aren't needed on the x86_64 version of alpine image. So either they are bundled in it, or the deasync dep doesn't have to be built on x86_64.

martadinata666 commented 2 years ago

in my exp building nodejs apps with arm64, few node_modules doesn't get built for arm64, so it need rebuild from source.

ThibaultNocchi commented 2 years ago

The two dockerfiles in master now have the needed packages. Feel free to tell us if it works or not :)

martadinata666 commented 2 years ago

Confirmed working beatifully 👍🏼

martadinata666 commented 2 years ago

Build fail nuxt not found check the Dockerfile

# Build client
RUN npm run build

So it expected nuxt to be available or exist before hannd, as the Dockerfile used to be

# Install dependencies
RUN npm ci --no-audit && \
  npm run build

Seems accidentally removed on #1685 ? Cant really tell, checking seems it not removed but the install deps part missing. 🤔

ThibaultNocchi commented 2 years ago

Doesn't seem like this commit is the culprit to me. Maybe you could do a cherry-pick to pinpoint the faulty commit? :)

martadinata666 commented 2 years ago

Oh sorry my fault, npm ci , it moved before # Set commit hash RUN if [[ $IS_STABLE == "0" ]] ; then NUXT_ENV_COMMIT=$(git rev-parse HEAD) ; fi

then i thought it missing. 🤦🏼

ThibaultNocchi commented 2 years ago

Np. Most importantly, does it work for you?