0

Basically I have the docker image with keycloak and an azure disk to persist the changes we make in keycloak. Unfortunately the machine does not get up because when mounting the azure disk in the path / opt / jboss it empties the content that already exists and cannot execute the entrypoint of the dockerfile ... any ideas? I try with subPath and without subPath.

volumeMounts:
        - mountPath: "/opt/jboss"
          subPath: "jboss"
          name: keycloak-volumen-test
algarcia95
  • 45
  • 1
  • 1
  • 4

1 Answers1

1

It seems the Azure Disk and Azure File will both cover the existing files. So you need to mount to a new folder which does not exist before. Maybe the Azure file is a better choice, you can copy the necessary files into the file share. Then the container will work as it does before.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • But I am using a docker image, how can I change the contents of that new folder to the original one before I try to lift the keycloak – algarcia95 May 27 '21 at 11:18
  • @algarcia95 For example, you can create a script or cron task to move or copy the data from the original folder to the new folder, you can set the new folder name when you create the image. – Charles Xu May 28 '21 at 00:59
  • I have a problem with that and it is that I am using the docker image jboss / keycloak and I cannot install the cron as it is redhat – algarcia95 Jun 07 '21 at 11:11
  • @algarcia95 Your choice. – Charles Xu Jun 08 '21 at 02:55