I am trying to create a new image based on the neo4j:latest
image. What is the proper way to persist to a new image and run a container based on the image?
I have these goals:
- Save the new password I assigned to the database.
- Keep data stored in the database.
I am using Windows 10 Docker Community Edition Version 18.06.0-ce-win72 (19098)
Here is what I have tried:
- Start a container from neo4j:latest.
I used this docker-compose.yml:
version: "3"
services:
neo4j:
image: neo4j:latest
ports:
- "7474:7474"
- "7687:7687"
networks:
webnet:
- Connect to neo4j using a browser. I set a new password, as is required.
http://localhost:7474/browser/
Load data into the database using a script run on my host. I verified that the database now contains nodes and relationships.
Commit the container to an image.
docker commit --author="Jacob Quisenberry" c5c3f2998895 jquisenberry/graphdb:latest
- Push the image to my repository.
docker push jquisenberry/graphdb:latest
- Run the image
docker run --expose=7474 --expose=7687 -p 7474:7474 -p 7687:7687 jquisenberry/graphdb:latest
- Connect using a browser.
I expected not to have to enter a new password and for my data to be intact.Instead, I am required to enter a new password. My database now lacks nodes and relationships.