§2024-08-20

I built a docker image with docker build --tag rocketchat:node_14.21.3 (--no-cache) --file ./Dockerfile.6.11.1 ./ Using the following Dockerfile.6.11.1

RocjetChat 6.11.1 requires NodeJs version 14.21.3

FROM node:14.21.3

OS Debian 10, buster

npm version is 6.14.18

yarn version is 3.5.0

Set environment variables

ENV MONGO_URL=mongodb://mongo:27017/rocketchat ENV ROOT_URL=http://localhost:3000 ENV PORT=3000 ENV ACCOUNT_SERVER_URL=http://localhost:3000

Create and set the working directory

WORKDIR /app

Install necessary dependencies

RUN apt-get update &&
apt-get install -y
build-essential
python3
python3-pip
python3-dev
git
curl
g++
make
autoconf
automake
libtool
pkg-config
libffi-dev
libssl-dev
libgmp-dev
libsqlite3-dev
libzmq3-dev
libncurses5-dev
libncursesw5-dev
libreadline-dev
zlib1g-dev
libbz2-dev
libvips-dev
libpango1.0-dev
libcairo2-dev
libjpeg-dev
libpng-dev
libtiff-dev
libgif-dev

Clone Rocket.Chat repository

RUN git clone https://github.com/RocketChat/Rocket.Chat.git /app

Set working directory to Rocket.Chat

WORKDIR /app

Checkout specific version

RUN git checkout 6.11.1

Install Rocket.Chat dependencies

RUB yarn cache clean

RUN yarn install

Expose the port Rocket.Chat runs on

EXPOSE 3000

Define the command to run Rocket.Chat

CMD ["npm", "start"]

Notes

sudo docker build --tag rocketchat:node_14.21.3 (--no-cache) --file ./Dockerfile.6.11.1 ./

sudo docker run -it rocketchat:node_14.21.3 /bin/bash

sudo docker run -d -p 42100:8000 --mount type=bind,source=/volume1/JupyterHub,target=/home/alexlai/JupyterHub --name jupyterhub jupyterhub:archlinux_x86_64_UTF-8 jupyterhub

outside-port:inside-port

docker ps

docker stop (NAMES)

docker rm (NAMES)11

2024-08-21

DEPRECATED: The legacy builder is deprecated and will be removed in a future release.

Install the buildx component to build images with BuildKit:

https://docs.docker.com/go/buildx/

```

ー errors in yarn install

➤ YN0000: ┌ Fetch step
➤ YN0013: │ yocto-queue@npm:0.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yocto-queue@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ zip-stream@npm:2.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ zustand@npm:4.3.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ zwitch@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0066: │ typescript@patch:typescript@npm%3A5.3.3#~builtin<compat/typescript>::version=5.3.3&hash=85af82: Cannot apply hunk #1
➤ YN0000: └ Completed in 8m 53s
➤ YN0000: ┌ Link step
➤ YN0007: │ @kaciras/deasync@npm:1.0.3 must be built because it never has been before or the last one failed
➤ YN0007: │ bcrypt@npm:5.0.1 must be built because it never has been before or the last one failed
➤ YN0007: │ fibers@npm:5.0.3 must be built because it never has been before or the last one failed
➤ YN0007: │ highlight.js@npm:9.18.5 must be built because it never has been before or the last one failed
➤ YN0007: │ isolated-vm@npm:4.4.2 must be built because it never has been before or the last one failed
➤ YN0007: │ sharp@npm:0.32.6 must be built because it never has been before or the last one failed
➤ YN0007: │ sodium-native@npm:3.3.0 must be built because it never has been before or the last one failed
➤ YN0007: │ @swc/core@npm:1.3.95 [86b19] must be built because it never has been before or the last one failed
➤ YN0007: │ @rocket.chat/forked-matrix-sdk-crypto-nodejs@npm:0.1.0-beta.13 must be built because it never has been before or the last one failed
➤ YN0007: │ @napi-rs/pinyin@npm:1.7.0 must be built because it never has been before or the last one failed
➤ YN0007: │ deno-bin@npm:1.37.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.20.2 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.21.1 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.21.1 must be built because it never has been before or the last one failed
➤ YN0007: │ gc-stats@npm:1.4.0 must be built because it never has been before or the last one failed
➤ YN0007: │ husky@npm:4.3.8 must be built because it never has been before or the last one failed
➤ YN0007: │ event-loop-stats@npm:1.4.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.17.19 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:2.6.12 must be built because it never has been before or the last one failed
➤ YN0007: │ gifsicle@npm:5.3.0 must be built because it never has been before or the last one failed
➤ YN0007: │ mozjpeg@npm:7.1.1 must be built because it never has been before or the last one failed
➤ YN0007: │ optipng-bin@npm:7.0.1 must be built because it never has been before or the last one failed
➤ YN0007: │ pngquant-bin@npm:6.0.1 must be built because it never has been before or the last one failed
➤ YN0007: │ cwebp-bin@npm:7.0.1 must be built because it never has been before or the last one failed
➤ YN0009: │ fibers@npm:5.0.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-2e06ced2/build.log)
➤ YN0009: │ fibers@npm:5.0.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-7fcea996/build.log)
➤ YN0009: │ optipng-bin@npm:7.0.1 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-59e2e23d/build.log)
➤ YN0007: │ @rocket.chat/apps-engine@npm:1.44.0 [4d8fd] must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 11m 45s
➤ YN0000: Failed with errors in 20m 49s

How to fix error /tmp/xfs-59e2e23d/build.log

# This file contains the result of Yarn building a package (optipng-bin@npm:7.0.1)
# Script name: postinstall

Command failed: /app/node_modules/optipng-bin/vendor/optipng --version
/app/node_modules/optipng-bin/vendor/optipng: 1: /app/node_modules/optipng-bin/vendor/optipng: @@8�@@@@@@@�@@@@����: not found
/app/node_modules/optipng-bin/vendor/optipng: 2: /app/node_modules/optipng-bin/vendor/optipng: d: not found
/app/node_modules/optipng-bin/vendor/optipng: 1: /app/node_modules/optipng-bin/vendor/optipng: Syntax error: ";" unexpected
/app/node_modules/optipng-bin/vendor/optipng: 1: /app/node_modules/optipng-bin/vendor/optipng: ELF: not found


optipng pre-build test failed
compiling from source
Error: Command failed: /bin/sh -c make install
pngrtran.c:99:1: warning: 'png_rtran_ok' defined but not used [-Wunused-function]
 png_rtran_ok(png_structrp png_ptr, int need_IHDR)
 ^~~~~~~~~~~~
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
pngxmem.c: In function 'pngx_malloc_rows_extended':
pngxmem.c:38:34: warning: comparison is always false due to limited range of data type [-Wtype-limits]
        (pngx_alloc_size_t)height > (pngx_alloc_size_t)(-1) / sizeof(png_bytep))
                                  ^
ar: `u' modifier ignored since `D' is the default (see `U')
/usr/bin/ld: ../libpng/libpng.a(pngrutil.o): in function `png_read_filter_row':
pngrutil.c:(.text+0x1e94): undefined reference to `png_init_filter_functions_neon'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:100: optipng] Error 1
make: *** [Makefile:14: install] Error 2

cd src/optipng && \
make install && \
cd ../..
make[1]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/optipng'
cd ../libpng && \
make -f Makefile PNGLIBCONF_H_PREBUILT=pnglibconf.h.optipng && \
cd ../optipng
make[2]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/libpng'
cp pnglibconf.h.optipng pnglibconf.h
gcc -c -I../zlib  -O2 -Wall -Wextra -o png.o png.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngerror.o pngerror.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngget.o pngget.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngmem.o pngmem.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngpread.o pngpread.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngread.o pngread.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrio.o pngrio.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrtran.o pngrtran.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrutil.o pngrutil.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngset.o pngset.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtrans.o pngtrans.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwio.o pngwio.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwrite.o pngwrite.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwtran.o pngwtran.c
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwutil.o pngwutil.c
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
ranlib libpng.a
gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtest.o pngtest.c
gcc  -L../zlib -o pngtest pngtest.o libpng.a -lz -lm
make[2]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/libpng'
cd ../opngreduc && \
make -f Makefile libopngreduc.a && \
cd ../optipng
make[2]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/opngreduc'
gcc -c  -O2 -Wall -Wextra  -I../libpng -o opngreduc.o opngreduc.c
ar cru libopngreduc.a opngreduc.o
ranlib libopngreduc.a
make[2]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/opngreduc'
cd ../gifread && \
make -f Makefile libgifread.a && \
cd ../optipng
make[2]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/gifread'
gcc -c  -O2 -Wall -Wextra -o gifread.o gifread.c
ar cru libgifread.a gifread.o
ranlib libgifread.a
make[2]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/gifread'
cd ../pnmio && \
make -f Makefile libpnmio.a && \
cd ../optipng
make[2]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/pnmio'
gcc -c  -O2 -Wall -Wextra -o pnmin.o pnmin.c
gcc -c  -O2 -Wall -Wextra -o pnmout.o pnmout.c
gcc -c  -O2 -Wall -Wextra -o pnmutil.o pnmutil.c
ar cru libpnmio.a pnmin.o pnmout.o pnmutil.o
ranlib libpnmio.a
make[2]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/pnmio'
cd ../minitiff && \
make -f Makefile libminitiff.a && \
cd ../optipng
make[2]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/minitiff'
gcc -c  -O2 -Wall -Wextra -o tiffread.o tiffread.c
gcc -c  -O2 -Wall -Wextra -o tiffutil.o tiffutil.c
ar cru libminitiff.a tiffread.o tiffutil.o 
ranlib libminitiff.a
make[2]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/minitiff'
cd ../pngxtern && \
make -f Makefile libpngxtern.a && \
cd ../optipng
make[2]: Entering directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/pngxtern'
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxread.o pngxread.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrbmp.o pngxrbmp.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrgif.o pngxrgif.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrjpg.o pngxrjpg.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrpnm.o pngxrpnm.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxrtif.o pngxrtif.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxio.o pngxio.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxmem.o pngxmem.c
gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio -I../minitiff -o pngxset.o pngxset.c
ar cru libpngxtern.a pngxread.o pngxrbmp.o pngxrgif.o pngxrjpg.o pngxrpnm.o pngxrtif.o pngxio.o pngxmem.o pngxset.o
ranlib libpngxtern.a
make[2]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/pngxtern'
gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o optipng.o optipng.c
gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o optim.o optim.c
gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o bitset.o bitset.c
gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o ioutil.o ioutil.c
gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o ratio.o ratio.c
gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc -I../pngxtern -o wildargs.o wildargs.c
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 
make[1]: Leaving directory '/tmp/904825a3-1e08-40df-88e6-c8313f673b01/src/optipng'

    at /app/node_modules/bin-build/node_modules/execa/index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async /app/node_modules/optipng-bin/lib/install.js:17:4