strapi / strapi-docker

Install and run your first Strapi project using Docker
https://strapi.io
MIT License
1.17k stars 445 forks source link

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

Open kyuumeitai opened 2 years ago

kyuumeitai commented 2 years ago

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.

microadam commented 2 years ago

@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

kyuumeitai commented 2 years ago

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

microadam commented 2 years ago

Awesome! Thank you :)

nguyenlamlll commented 2 years ago

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!

KingProphecyhk commented 2 years ago

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