Docker Community Forums

Share and learn in the Docker community.

Persistent Data - DockerFile


(Killertjuh) #1


I`m tryning to exlain what for problem i have.
At this point i have the following situation:

            Linux server
         Docker private registry
         |              |
    docker client      docker client

At the linux server ill create the DockerFile and build everything. When im done i`ll push everything to the registry server.
Cronjob on the dockerclient looks for any difference between the image registry and local image. Download the new image and start the container.

At this point i use parameter volume within the DockerFile. But sometimes when i`ll create a new image (linux server) the current data at the client side is gone. Because i have a new image with a different hash. So i have a new volume data container.

I can create a data-only container with Dockerfile and docker-compose(client side) use volume-from for the data but how do i get the application data into the data-only-container.

1, Data-Only-Container (create with dockerfile)
2. Install application (create with a different dockerfile then step 1 but how can i use the Data-Only-Contaier from step 1 because the installation need to save data.)

Ore is there any different way to fix this problem?

(Killertjuh) #2

Reply on my own post. Can this solve my problemen?

When i`ll set a image id do i have always the same hash so i dont lose any data when i upgrade the image when building form scratch?