简体   繁体   中英

How to add plugins to Neo4j Docker Container at build phase instead of dowloading plugins at container run?

I need my neo4j service to use few plugins. My Neo4j Docker build file is:

FROM neo4j:3.5.14
ENV NEO4J_AUTH='neo4j/password'
ENV NEO4J_ACCEPT_LICENSE_AGREEMENT='yes'
ENV NEO4JLABS_PLUGINS='["apoc", "graph-algorithms"]'
RUN echo "dbms.security.procedures.unrestricted=algo.*" >> ./conf/neo4j.conf

The part ENV NEO4JLABS_PLUGINS='["apoc", "graph-algorithms"]'

will download the listed plugins on container run and install them.

But, i have to run this container in a restricted environment, and i do not have internet access. I cannot download the plugins on container run.

**What can i do to add these plugins at the build phase itself, so that they come ready with the image? **

You can try building and deploying your docker in a non-restricted environment, install everything, and then:

docker commit your-docker your-new-image-with-all-installed
docker save your-new-image-with-all-installed > your-image.tar

After that, you can take this image to your restricted (without internet) environment and deploy with:

docker load < your-image.tar
docker run ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM