I have logged in to virtual machine in docker but I can't find standalone.sh It isn't in /bin. I don't know also how to write dockerfile which set -Djboss.socket.binding.port-offset=100
You can pass port as -Djboss.http.port parameter, for example:
docker run --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 11111:11111 jboss/keycloak -Djboss.http.port=11111
Below is a sample docker-compose YAML file which shows you may set the offset in the command. Please kindly change according to your setting.
version: '2.1'
services:
keycloak:
image: jboss/keycloak:4.5.0.Final
container_name: keycloak
user: change_it
hostname: change_it
command: ["-Djboss.socket.binding.port-offset=0"]
extra_hosts:
- "change_it"
environment:
- KEYCLOAK_USER=change_it
- KEYCLOAK_PASSWORD=change_it
ports:
- 8080:8080
- 8443:8443
This worked for me as in to change the default port of keycloak server through docker file. (keycloak runs on localhost:8100)
keycloak:
build:
context: ./keycloak
dockerfile: ./Dockerfile
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_DEFAULT_THEME: custom
KEYCLOAK_WELCOME_THEME: keycloak
DB_VENDOR: h2
container_name: keycloak-container
command: ["-Djboss.http.port=8100"]
# Uncomment for development purpose
# volumes:
# - ${PWD}/keycloak/theme/custom:/opt/jboss/keycloak/themes/custom
ports:
- 8100:8100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With