Neo4j + Docker - unable to create JVM

Viewed 2179

I'm trying to build a docker container for a Neo4j DB. While running the db locally isn't an issue, the container is having issues starting the JVM. Looking through the neo4j:3.2.2 image I'm building my own Dockerfile from I can't see us using different versions of the JRE. The issue seems to stem from they neo4j.conf, where It crashes on unrecognized VM option flags, such as UseG1GC and OmitStackTraceInFastThrow

The Dockerfile is fairly short

FROM neo4j:3.2.2
ADD ./neo4j.conf /var/lib/neo4j/conf/.
ADD ./data/. /var/lib/neo4j/import
ADD ./scripts/. .

I've also got a docker-compose.yml

version: '2'
 services:
  neo4j:
    image: eu.gcr.io/tine-matsans-v2/neo4j:develop
    container_name: neo4j
    build:
      context: ./neo4j/.
    ports:
      - "7474:7474"
      - "7473:7473"
      - "7687:7687"
    environment:
      - NEO4J_USERNAME=neo4j
      - NEO4J_PASSWORD=litago

I'm on a Windows 10 machine, but the image builds a unix container. My colleague has no issues whatsoever with running the container, using the same configs, though he's using a Mac. That should not be relevant as the issue is within the container.

neo4j            | Active database: graph.db
neo4j            | Directories in use:
neo4j            |   home:         /var/lib/neo4j
neo4j            |   config:       /var/lib/neo4j/conf     
neo4j            |   logs:         /var/lib/neo4j/logs
neo4j            |   plugins:      /var/lib/neo4j/plugins
neo4j            |   import:       /var/lib/neo4j/import
neo4j            |   data:         /var/lib/neo4j/data
neo4j            |   certificates: /var/lib/neo4j/certificates
neo4j            |   run:          /var/lib/neo4j/run
neo4j            | Starting Neo4j.
neo4j            | Unrecognized VM option 'UseG1GC
neo4j            | Did you mean '(+/-)UseG1GC'?
neo4j            | Error: Could not create the Java Virtual Machine.
neo4j            | Error: A fatal exception has occurred. Program will exit.

Has anyone run into similar issues? I've searched through several stack overflow posts as well as tried to read up on how the JVM and Containers work, but I can't find any solid information to help me sort this out.

3 Answers

I easily solved this issue with Sublime. You can check your current line ending at menu -> view -> line endings. Just turn it into Unix and save.

I hope this helps others.

Related