Keycloak docker container fails to import realm from volume











up vote
0
down vote

favorite












I want to run keycloak container with below docker compose file.



version: '2.1'

services:
# keycloak
keycloak:
container_name: keycloak
image: jboss/keycloak:latest
restart: always
ports:
- 8080:8080
volumes:
- C:logskeycloak:/usr/app/logs
- C:settings:/etc/settings
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- KEYCLOAK_IMPORT=/etc/settings/realm.json


Everything except realm import works fine in this case.
This is shortcut of the error thrown during container run:




Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)
Caused by: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)"}`




I am sure the file exists in this location.
I have checked several different configurations for import e.g. specyfing imported file: C:settingsrealm.json:/etc/settings/realm.json but the result is the same.
Have you got any ideas how the proper configuration should look like?










share|improve this question
























  • What is your environment? Are you trying to run Linux container on Windows host?
    – Moisei
    Nov 7 at 13:07















up vote
0
down vote

favorite












I want to run keycloak container with below docker compose file.



version: '2.1'

services:
# keycloak
keycloak:
container_name: keycloak
image: jboss/keycloak:latest
restart: always
ports:
- 8080:8080
volumes:
- C:logskeycloak:/usr/app/logs
- C:settings:/etc/settings
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- KEYCLOAK_IMPORT=/etc/settings/realm.json


Everything except realm import works fine in this case.
This is shortcut of the error thrown during container run:




Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)
Caused by: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)"}`




I am sure the file exists in this location.
I have checked several different configurations for import e.g. specyfing imported file: C:settingsrealm.json:/etc/settings/realm.json but the result is the same.
Have you got any ideas how the proper configuration should look like?










share|improve this question
























  • What is your environment? Are you trying to run Linux container on Windows host?
    – Moisei
    Nov 7 at 13:07













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to run keycloak container with below docker compose file.



version: '2.1'

services:
# keycloak
keycloak:
container_name: keycloak
image: jboss/keycloak:latest
restart: always
ports:
- 8080:8080
volumes:
- C:logskeycloak:/usr/app/logs
- C:settings:/etc/settings
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- KEYCLOAK_IMPORT=/etc/settings/realm.json


Everything except realm import works fine in this case.
This is shortcut of the error thrown during container run:




Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)
Caused by: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)"}`




I am sure the file exists in this location.
I have checked several different configurations for import e.g. specyfing imported file: C:settingsrealm.json:/etc/settings/realm.json but the result is the same.
Have you got any ideas how the proper configuration should look like?










share|improve this question















I want to run keycloak container with below docker compose file.



version: '2.1'

services:
# keycloak
keycloak:
container_name: keycloak
image: jboss/keycloak:latest
restart: always
ports:
- 8080:8080
volumes:
- C:logskeycloak:/usr/app/logs
- C:settings:/etc/settings
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- KEYCLOAK_IMPORT=/etc/settings/realm.json


Everything except realm import works fine in this case.
This is shortcut of the error thrown during container run:




Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)
Caused by: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)"}`




I am sure the file exists in this location.
I have checked several different configurations for import e.g. specyfing imported file: C:settingsrealm.json:/etc/settings/realm.json but the result is the same.
Have you got any ideas how the proper configuration should look like?







java docker keycloak






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 12:16









Karol Dowbecki

13.2k62745




13.2k62745










asked Nov 7 at 12:14









Zebedeusz

11




11












  • What is your environment? Are you trying to run Linux container on Windows host?
    – Moisei
    Nov 7 at 13:07


















  • What is your environment? Are you trying to run Linux container on Windows host?
    – Moisei
    Nov 7 at 13:07
















What is your environment? Are you trying to run Linux container on Windows host?
– Moisei
Nov 7 at 13:07




What is your environment? Are you trying to run Linux container on Windows host?
– Moisei
Nov 7 at 13:07












1 Answer
1






active

oldest

votes

















up vote
0
down vote













SOLVED
It appears that the error may be described as follows.
error: File is mounted as a directory or mounted directories are empty.
reason: Password change to OS.
explanation: Docker cannot access files on the system that it works on, as it is after all a virtual machine, due to system’s password change. It does not inform about fail in accessing the file system either, just displays mounted directories in an invalid manner.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189281%2fkeycloak-docker-container-fails-to-import-realm-from-volume%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    SOLVED
    It appears that the error may be described as follows.
    error: File is mounted as a directory or mounted directories are empty.
    reason: Password change to OS.
    explanation: Docker cannot access files on the system that it works on, as it is after all a virtual machine, due to system’s password change. It does not inform about fail in accessing the file system either, just displays mounted directories in an invalid manner.






    share|improve this answer

























      up vote
      0
      down vote













      SOLVED
      It appears that the error may be described as follows.
      error: File is mounted as a directory or mounted directories are empty.
      reason: Password change to OS.
      explanation: Docker cannot access files on the system that it works on, as it is after all a virtual machine, due to system’s password change. It does not inform about fail in accessing the file system either, just displays mounted directories in an invalid manner.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        SOLVED
        It appears that the error may be described as follows.
        error: File is mounted as a directory or mounted directories are empty.
        reason: Password change to OS.
        explanation: Docker cannot access files on the system that it works on, as it is after all a virtual machine, due to system’s password change. It does not inform about fail in accessing the file system either, just displays mounted directories in an invalid manner.






        share|improve this answer












        SOLVED
        It appears that the error may be described as follows.
        error: File is mounted as a directory or mounted directories are empty.
        reason: Password change to OS.
        explanation: Docker cannot access files on the system that it works on, as it is after all a virtual machine, due to system’s password change. It does not inform about fail in accessing the file system either, just displays mounted directories in an invalid manner.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 7 at 13:16









        Zebedeusz

        11




        11






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189281%2fkeycloak-docker-container-fails-to-import-realm-from-volume%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Hercules Kyvelos

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud