Nerzal / gocloak

golang keycloak client
Apache License 2.0
1.01k stars 277 forks source link

Contributions Wiki is outdated #403

Open dheeraj-326 opened 1 year ago

dheeraj-326 commented 1 year ago

Describe the bug The first step for developer environment setup in the contributions wiki for running a docker container of Keycloak is broken. Newer versions of Keycloak expects different set of command line arguments during startup.

Below are the changes:

  1. We need to provide an additional argument start or start-dev.
  2. Command line realm creation does not work anymore (https://github.com/keycloak/keycloak/issues/10216). It has been removed for some reason. To overcome this we must either: 2.1 Create admin username and password while running the container using the KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASWORD environments and then ask the developer to manually import the realm json by logging in 2.2 It seems that Keycloak does allow import of realms once the server has started up by running /opt/keycloak/bin/kcadm.sh create realms -f /tmp/realm.json' from within the container. If we are going to do this, we can create a DockerFile which builds on top of the official image and add a step to run this from within that file.

To Reproduce Steps to reproduce the behavior:

  1. Go to contributions wiki and run the first step to run keycloak container

Expected behavior Keycloak starts up without issue.

Screenshots Does not start. image

Desktop (please complete the following information):

Additional context I would like the maintainers of this repo to please chime in with their suggestions as to which approach to take.

dheeraj-326 commented 1 year ago

@Nerzal The Dockerfile for Keycloak already exists in the repo. Only the Wiki needs to be updated. I have ran the below commands and it works. You cannot update them in place of the existing docker run command as I cannot contribute to the Wiki.

docker build -t gocloak-kc .
docker run -d -p 8080:8080 --name keycloak gocloak-kc start-dev
Nerzal commented 1 year ago

Oh sorry i forgot to answer to the issue. The best way to test gocloak locally ist to use the makefile, which makes use of docker compose