cancel
Showing results for 
Search instead for 
Did you mean: 

Neo4j in Docker plugins are not recognized

martin_ebert
Node Clone

When I run Neo4j in Docker, the plugins don't work. In my case: APOC and ALGO.

1.What did I do? Dockerfile created.

FROM neo4j:3.5.8

# Enable APOCs
ENV APOC_VERSION 3.5.0.4
ENV APOC_URL https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/${APOC_VERSION}/apoc-${APOC_VERSION}-all.jar
RUN (cd /var/lib/neo4j/plugins && curl -OL $APOC_URL)

# Enable Algorithms
ENV ALGOS_VERSION 3.5.8.0
ENV ALGOS_URL http://s3-eu-west-1.amazonaws.com/com.neo4j.graphalgorithms.dist/neo4j-graph-algorithms-$ALGOS_VERSION-standalone.jar
RUN (cd /var/lib/neo4j/plugins && curl -OL $ALGOS_URL)

EXPOSE 7474 7473 7687

RUN apt-get update
RUN apt-get install nano

CMD ["neo4j"]
  1. Build image
docker build --tag=myimage .
  1. Run Container
docker run \
    --name my_container \
    -p 7474:7474 -p 7687:7687 \
    -v $HOME/neo4j/data:/data \
    -v $HOME/neo4j/logs:/logs \
    -v $HOME/neo4j/plugins:/plugins \
    -e NEO4J_dbms_memory_pagecache_size=4G \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    -e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*,algo.\\\* \
    -e NEO4J_AUTH=neo4j/neo4j \
    myimage

In the config file the highlighted definition looks a little bit wrong.
2X_9_902e657a04212d8fcf73a5aa82dbea84203040fb.png

But even if I correct this manually

dbms.security.procedures.unrestricted=apoc.*,algo.*

and use "neo4j restart", I can't use apoc or algo functionality.

2X_a_a8b1be1c379e257417140e1c296fb25d4e7e6fab.png

How do I get this to work?

The plugins themselves are in the right folder:
2X_9_93100d8469851f78a976eb2b7dd5bd9e9e67bae0.png

1 ACCEPTED SOLUTION

david_allen
Neo4j
Neo4j

What I think your dockerfile says is that you built the plugins into a custom container you built -- and then also mounted a /plugins directory over top of what the container you built provided. So maybe the directory you mounted (which shouldn't have been necessary) didn't contain them?

Note that if you use the vanilla docker container and do what @david.fauth was suggesting it should work. You can either build the plugins into the container and run your container without argument, or use the vanilla container and run with a mount argument -- but don't do both.

View solution in original post

4 REPLIES 4

david_fauth
Neo4j
Neo4j

Can you try mounting your plugins directory as /var/lib/neo4j/plugins

Dave

@andrew.jefferson worked on some cool stuff.

Try it out:

I have the same issue regarding apoc running in docker.

I have the same issue How can I fix it ?

Here is the link : https://community.neo4j.com/t5/drivers-stacks/neo4j-with-shortestpath-by-using-many-cities-with-its-...

david_allen
Neo4j
Neo4j

What I think your dockerfile says is that you built the plugins into a custom container you built -- and then also mounted a /plugins directory over top of what the container you built provided. So maybe the directory you mounted (which shouldn't have been necessary) didn't contain them?

Note that if you use the vanilla docker container and do what @david.fauth was suggesting it should work. You can either build the plugins into the container and run your container without argument, or use the vanilla container and run with a mount argument -- but don't do both.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.