Neo4j in Docker plugins are not recognized

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.
image

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.

image

How do I get this to work?

The plugins themselves are in the right folder:
image

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

Dave

@andrew.jefferson worked on some cool stuff.

Try it out:

3 Likes

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.