lv_img_conv
lv_img_conv copied to clipboard
Running in container fails
I followed the steps in the README to run lv_img_conv
in a container:
docker build -t lv_img_conv .
It fails to build [email protected]
. Adding the missing dependency
RUN apt update && apt install libsdl-pango-dev -y
to the docker solves this.
However if I then run
docker run -ti --rm -u 1000:1000 lv_img_conv lv_img_conv.js
it fails with:
npx: installed 17 in 1.434s
@swc/core threw an error when attempting to validate swc compiler options.
You may be using an old version of swc which does not support the options used by ts-node.
Try upgrading to the latest version of swc.
Error message from swc:
Failed to deserialize buffer as swc::config::Options
JSON: {"sourceMaps":true,"module":{"type":"commonjs","noInterop":false,"strictMode":true,"ignoreDynamic":false},"swcrc":false,"jsc":{"parser":{"syntax":"typescript","tsx":false,"dynamicImport":true,"importAssertions":true},"target":"es5","transform":{"legacyDecorator":true,"react":{"throwIfNamespace":false,"useBuiltins":false,"runtime":"automatic"},"useDefineForClassFields":false},"keepClassNames":false,"experimental":{"keepImportAttributes":true,"emitAssertForImportAttributes":true}}}
Caused by:
unknown field `keepImportAttributes`, expected one of `plugins`, `keepImportAssertions`, `cacheRoot` at line 1 column 484
My team is having the same issue on a build that hasn't changed but has suddenly started failing on our CI machines with the same error.
That Dockerfile is just wrong it seems:
I managed to get it to work with the following Dockerfile
FROM ubuntu:20.04
ENV PATH=/usr/src/app:$PATH
RUN mkdir -p /usr/src/app
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt install -y gcc make g++ pkg-config libpixman-1-dev libcairo2-dev libpango1.0-dev libjpeg8-dev libgif-dev nodejs npm
RUN npm install -g ts-node
COPY . /usr/src/app
RUN cd /usr/src/app && npm install
VOLUME /usr/src/proj
WORKDIR /usr/src/proj
ENTRYPOINT ["entrypoint.sh"]