Closed Javarome closed 2 years ago
Same issue for me on node:14 docker image.
I've had to switch over to slim temporariliy:
FROM node:slim
RUN apt-get update && apt-get install -y -q --no-install-recommends libfontconfig1
I wasn't able to get the most recent version of Skia to build on Debian Stretch anymore since it lacks the string_view
header (among other recent C++isms that Skia depends on). The solution when using node 14 on docker is to use the node:14-buster
image (which has glibc 2.31) instead of the stretch-based node:14
(which is still on 2.24).
As for Google Cloud, I don't know much about it but it seems like the error you're running into is a common one. Are you able to provide your own image to run on instead of using the default environment?
We workarounded it by indeed using our own docker image, using a Dockerfile like:
# Use the base App Engine Docker image, based on Ubuntu 20.0.4.
FROM ubuntu:20.04
# Install updates and dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install --no-install-recommends -y -q \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
imagemagick \
libkrb5-dev \
netbase \
gnupg \
libfontconfig1 \
python && \
apt-get upgrade -y && \
apt-get clean && \
rm /var/lib/apt/lists/*_*
# Install node & yarn
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null && \
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn
# Copy application code.
COPY xxx /app/xxx
COPY yarn.lock /app/
WORKDIR /app
# Install packages
RUN yarn server:build
# Set common env vars
ENV NODE_ENV production
ENV PORT 8080
# start
CMD ["yarn", "start"]
and in our gcloud yaml file, switching from:
runtime: nodejs16
instance_class: F4_1G
to
runtime: custom
env: flex
Recently building on Google Cloud started to fail because of this:
Required is:
and Google Build install Node v16.15.0. Also tried
"16.x.x
,14.x
, but same error using skia-canvas0.29
or0.30
.I'll be happy to provide any other info or attempts workarounds.