strapi-docker icon indicating copy to clipboard operation
strapi-docker copied to clipboard

strapi/base:14: Graphql plugin with 14.17 dependency; strapi base uses 14.16

Open kyuumeitai opened this issue 3 years ago • 5 comments

If you try to use docker/base in your Dockerfile and installing Graphql plugin on docker-entrypoint.sh after, you'll see the graphql-upload dependency demands 14.17.0 https://github.com/jaydenseric/graphql-upload/blob/master/package.json#L45

I ended removing nodejs link on my docker-entrypoint.sh and installing manually with curl similar to strapi/base does:

rm -rf /usr/local/bin/nodejs

/bin/sh -c ARCH= && dpkgArch="$(dpkg --print-architecture)"   && case "${dpkgArch##*-}" in     amd64) ARCH='x64';;     ppc64el) ARCH='ppc64le';;     s390x) ARCH='s390x';;     arm64) ARCH='arm64';;     armhf) ARCH='armv7l';;     i386) ARCH='x86';;     *) echo "unsupported architecture"; exit 1 ;;   esac   && set -ex   && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner  && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz"  && ln -s /usr/local/bin/node /usr/local/bin/nodejs   && node --version   && npm --version

That way you can install strapi-plugin-graphql without further issues.

kyuumeitai avatar Jan 26 '22 19:01 kyuumeitai

@kyuumeitai having the same issue. Could you please provide your Dockerfile / link to whatever it is you are referencing by installing manually with curl similar to strapi/base does? As I can't find anything that does something like your example

microadam avatar Feb 08 '22 13:02 microadam

Hi @microadam ! I made an example in the following repository based on my solution, I hope it helps you.

https://github.com/kyuumeitai/strapi-docker-node-issue

kyuumeitai avatar Feb 08 '22 15:02 kyuumeitai

Awesome! Thank you :)

microadam avatar Feb 08 '22 16:02 microadam

Thank you a lot for your hints. However, that part /bin/sh -c ARCH= && dpkgArch="$(dpkg --print-architecture)" ... looks scary to me (I am no Linux expert). May you please explain what it is, or maybe you can just throw me a doc or something to read? Thanks!

nguyenlamlll avatar Feb 18 '22 19:02 nguyenlamlll

Same problem here, strapi need to update the docker image to use node 16

KingProphecyhk avatar Mar 04 '22 09:03 KingProphecyhk