Starting up keycloak in a docker container using docker for windows can be a bit tricky the first time you try. For me the main issues were waiting for the container to start up and setting the admin password.
Docker Hub container
I have been using this Keycloak docker image found on docker hub Jboss/KeyCloak. The image itself as directions on how to install it but I have a few tips.
Boot it
There are a few things that you can do to change the ports. I peronally found that just booting it in standalone mode worked the best for my setup.
To boot in standalone mode
docker run jboss/keycloak
This gives us a very basic default version of keycloak
It will be running on port 8080
Wait
When you run the command above it will take a minute for the container to start. Once you see the text scrolling on the screen you know that the container has started. I found that the Status from a docker ps was not actuate in displaying the status of the container.
Password
By default this version will not have an admin password which means that you wont be able to use the admin UI. To add a password we will need to do the following.
docker exec <CONTAINER> /opt/jboss/keycloak/bin/add-user-keycloak.sh -u <USERNAME> -p <PASSWORD>
This will create a password in your already running container. Remember you do docker ps to find the container id of your running container.
Once that command has run you will need to restart the container this can be done by stopping it and then restarting it.
docker stop <CONTAINER>
docker start <CONTAINER> -a
The -a just attaches the output to the container so that we can watch and wait for it to complete starting. Once you know its working you will not need to do that.
Once you see the following you should know its all up and running
You can then navigate to http://localhost:8080/auth/admin in your web browser and login to the admin section of keycloak.
I am not able to find add-user-keycloak.sh in keyclaok container