Open sdaschner opened 4 years ago
What's the log output of the docker build? Neo4j needs to be started as the neo4j:neo4j
user, but your Dockerfile will be running it as root
, which might be causing problems.
Could you also try adding USER neo4j:neo4j
before your RUN
?
Sure:
---> Running in 05bf08ff960e
Changed password for user 'neo4j'.
Active database: graph.db
Directories in use:
home: /var/lib/neo4j
config: /var/lib/neo4j/conf
logs: /var/lib/neo4j/logs
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/lib/neo4j/run
Starting Neo4j.
Started neo4j (pid 121). It is available at http://localhost:7474/
There may be a short delay until the server is ready.
See /var/lib/neo4j/logs/neo4j.log for current status.
0 rows available after 212 ms, consumed after another 0 ms
Added 1 constraints
0 rows available after 171 ms, consumed after another 0 ms
Stopping Neo4j.. stopped
Removing intermediate container 05bf08ff960e
---> e33d33c85441
Successfully built e33d33c85441
Adding the USER
directive didn't change anything. The contents of all the directories and logs are empty on start of the image (here e33d33c85441
)...
Hello @sdaschner, seems like you have the same isssue as here: https://github.com/neo4j/docker-neo4j/issues/166 Please try to follow this workaround and let us know if it works for you. Thanks.
I expected that I can modify the initial state of database in the
Dockerfile
, e.g. creating some indexes. It seems, however, that the state that I persist during the build steps is lost, maybe due to the entrypoint script?Steps to reproduce
Following Dockerfile:
Following
schema.cypher
:The resulting database image, after a
docker build -t <image> .
however is empty, without any indexes. If I run theRUN
steps manually in a Docker container, it works as expected.Tested with both
neo4j:4.0.4-enterprise
andneo4j:3.5.14-enterprise
.