Search posts, tags, users, and pages
Thank you for the detailed guide!
Unfortunately, it failed at the stage of creating a docker image. I'm using the m1 Silicon Mac Book. The error message is as follows.
sharp: Installation error: Use with glibc 2.28 requires manual installation of libvips >= 8.11.3
The docker node16 image can't be bullseye, before yarn install,
RUN apt-get update -y && \
apt-get upgrade -y libvips libvips-dev
Installing libvips with the above command failed with the same error message.
Is there a good way to solve it?
Mincheol Kim Depending on deployment, if you are working on mac you can always install brew yourself
brew install vips
Note that if we are using an alpine image it's also different, as it's using musl linux and not glibc etc.
Simen Daehlin Thank you for your answer. I'm a junior developer, so I don't understand it properly. To install vips with Brew means to install it locally, not in the docker container?
docker build -t mystrapi:latest .
When executed with the command above, it fails in the yarn install part. How can I modify the Dockerfile to install vips with brew?
Below is the error log of the docker build.
=> ERROR [6/9] RUN yarn install 77.3s
------
> [6/9] RUN yarn install:
#11 0.330 yarn install v1.22.15
#11 0.383 [1/5] Validating package.json...
#11 0.385 [2/5] Resolving packages...
#11 0.634 [3/5] Fetching packages...
#11 35.11 info fsevents@2.3.2: The platform "linux" is incompatible with this module.
#11 35.11 info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
#11 35.12 [4/5] Linking dependencies...
#11 35.12 warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.0.7" has unmet peer dependency "formik@^2.2.6".
#11 35.12 warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.0.7" has unmet peer dependency "immer@9.0.6".
#11 35.12 warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.0.7" has unmet peer dependency "qs@6.10.1".
#11 35.12 warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.0.7" has unmet peer dependency "react-select@^4.0.2".
#11 35.12 warning "@strapi/plugin-users-permissions > react-redux@7.2.3" has unmet peer dependency "redux@^2.0.0 || ^3.0.0 || ^4.0.0-0".
#11 35.12 warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha".
#11 35.12 warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha".
#11 35.12 warning "@strapi/strapi > @strapi/admin > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
#11 35.12 warning "@strapi/strapi > @strapi/admin > webpack-dev-server > http-proxy-middleware@2.0.2" has unmet peer dependency "@types/express@^4.17.13".
#11 35.12 warning "@strapi/plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
#11 35.15 warning Workspaces can only be enabled in private projects.
#11 43.85 [5/5] Building fresh packages...
#11 44.94 error /opt/node_modules/sharp: Command failed.
#11 44.94 Exit code: 1
#11 44.94 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
#11 44.94 Arguments:
#11 44.94 Directory: /opt/node_modules/sharp
#11 44.94 Output:
#11 44.94 sharp: Installation error: Use with glibc 2.28 requires manual installation of libvips >= 8.11.3
#11 44.94 sharp: Please see sharp.pixelplumbing.com/install for required dependencies
#11 44.94 info Visit yarnpkg.com/en/docs/cli/install for documentation about this command.
------
executor failed running [/bin/sh -c yarn install]: exit code: 1
So it's two things here. Sharp gets compiled, and uses this in the container so installing sharp on your mac should allow the container to build it.
If you need it inside the container, you can add
RUN apt-get update && apt-get install libvips libvips-dev -y
This is the line after from node...
What you wrote in previous does an upgrade and update not installing the package.
Unfortunately, the same error occurred when installed in my m1 MacBook, and the same problem continued when installed in the container.
I solved it by entering the command
platform: linux/amd64
in the docker-compose.yml file.
Thank you for the great guide!
Experiencing same issue but in Development Docker image build - did you find a work-around for that?