Persist Changes to New Docker Image - neo4j
Regarding to Neo4j with Docker and Insallation: Docker


  /data to allow the database to be persisted outside its container.
  
  /logs to allow access to Neo4j log files.


I understand that we should mount the /data to the host machine so that the new password is persisted as the following example.

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=/path/to/neo4j/data:/data \
    --volume=/path/to/neo4j/logs:/logs \
    neo4j:latest


Note, the /path/to/neo4j is a physical directory on the host machine.

Edit1

To set password, the Insallation: Docker mentions as


  By default Neo4j requires authentication and requires you to login with neo4j/neo4j at the first connection and set a new password. 
  
  You can set the password for the Docker container directly by specifying --env NEO4J_AUTH=neo4j/&lt;password&gt; in your run directive. Alternatively, you can disable authentication by specifying --env NEO4J_AUTH=none instead.


Then the docker run should be

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --env NEO4J_AUTH=neo4j/&lt;password&gt; \
    --volume=/path/to/neo4j/data:/data \
    --volume=/path/to/neo4j/logs:/logs \
    neo4j:latest


Anyhow for the /data, I only achieve with mounting it to the host machine.