1

I wanted to dockerize galenframework tests. Here is what I have currently:

DockerFile

FROM node:8.6
RUN mkdir -p /usr/src/galen
WORKDIR /usr/src/galen
COPY package.json /usr/src/galen/
RUN npm install
COPY . /usr/src/galen

docker-compose.yml

version: '2'
services:
  galenframework:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/usr/src/galen

package.json

{
  "name": "docker_galen",
  "version": "1.0.0",
  "description": "Node.js on Docker with Galen",
  "dependencies": {
    "galenframework-cli": "2.3.5"
  }
}

after running docker-compose up -d I get following error:

info Install exited unexpectedly npm info lifecycle galenframework-cli@2.3.5~postinstall: Failed to exec postinstall script npm WARN docker_galen@1.0.0 No repository field. npm WARN docker_galen@1.0.0 No license field. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! galenframework-cli@2.3.5 postinstall: node postinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the galenframework-cli@2.3.5 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

How can I fix this?

Veve
  • 6,643
  • 5
  • 39
  • 58
ikari2k
  • 27
  • 5
  • I tried to rerruning this on java 8 alpine image because I thought this error might be related to java dependency, so first line of DockerFile changed to `FROM java:8-jdk-alpine RUN set -ex && \ apk upgrade --update && \ . That did not help... apk add --update nodejs` – ikari2k Oct 03 '17 at 14:22
  • Try changing `npm install` with `yarn install` and see if it helps. Also do remember that `.:/usr/src/galen` volume mapping will override all the node_modules you had installed inside the dockerfile – Tarun Lalwani Oct 03 '17 at 19:52

1 Answers1

1

You need Java to run Galen, so this should work

FROM java:8

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 6.11.4
ENV GALEN_VERSION 2.3.5

# Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
    && . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
    && nvm alias default $NODE_VERSION \
    && nvm use default \
    && npm install -g galenframework-cli@$GALEN_VERSION

ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH      $NVM_DIR/v$NODE_VERSION/bin:$PATH
hypery2k
  • 1,681
  • 15
  • 20