Saludos:
Estoy intentando instalar Openproject bajo Docker en una Raspberry Pi. Pensaba que iba a ser una tarea fácil ya que Openproject proporciona una imagen de Docker lista para descargar y poner a funcionar; sin embargo no ha sido así.
Dando un vistazo a las fuentes de Openproject, en concreto al Dockerfile veo que instalan Node.js por binario, en concreto por un binario para x86 así que, me he felicitado por ser solución fácil.
He modificado el Dockerfile para instalar la versión para Armv7 de Node.js y he intentado reconstruir la imagen pero… agua:
Step 25/35 : RUN cd /tmp/npm/frontend/ && RAILS_ENV=production npm install --ignore-scripts
---> Running in b422318f10a1
/usr/bin/env: node: No such file or directory
The command '/bin/sh -c cd /tmp/npm/frontend/ && RAILS_ENV=production npm install --ignore-scripts' returned a non-zero code: 127
Buscando por la red había llegado a que faltaba un enlace desde /usr/local/bin/node
a /usr/bin/node
pero… no ha sido así.
No he conseguido encontrar nada más a lo que aferrarme y, por ello, os solicito ayuda.
Las modificaciones del Dockerfile:
$ git diff Dockerfile
diff --git a/Dockerfile b/Dockerfile
index d7b1cbb..3dd8f29 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,8 +4,8 @@ ENV NODE_VERSION="7.7.2"
ENV BUNDLER_VERSION="1.11.2"
# install node + npm
-RUN curl https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz | tar xzf - -C /usr/local --strip-components=1
-
+RUN curl https://nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-armv7l.tar.gz | tar xzf - -C /usr/local --strip-components=1
+#
# Using /home/app since npm cache and other stuff will be put there when running npm install
# We don't want to pollute any locally-mounted directory
RUN useradd -d /home/app -m app
@@ -33,8 +33,10 @@ USER root
COPY package.json /tmp/npm/package.json
COPY frontend/*.json /tmp/npm/frontend/
RUN chown -R app:app /tmp/npm
+RUN ln -s /usr/local/bin/node /usr/bin/node
USER app
+RUN echo "¿Esta node enlazado?" && ls -lh /usr/bin/n*
RUN cd /tmp/npm/frontend/ && RAILS_ENV=production npm install --ignore-scripts
RUN mv /tmp/npm/frontend /usr/src/app/
@@ -50,4 +52,4 @@ USER app
RUN cd frontend && npm run postinstall
RUN DATABASE_URL=sqlite3:///tmp/db.sqlite3 SECRET_TOKEN=foobar RAILS_ENV=production bundle exec rake assets:precompile
-CMD ["./docker/web"]
\ No newline at end of file
+CMD ["./docker/web"]
¡Ah! Por probar a ver si era problema de la imagen, la he recreado en mi máquina normal y la construye perfectamente, así que atribuyo el error a algo del Node.js para Arm. :^(
Gracias por adelantado.
Salud y Revolución.
Lobo.