How to export realm file into keycloak docker container?
You can start a temporary container. I'm using swarm and attachable network, but replacing the --network flag with some --link to the DB container should do it for a vanilla docker container :
docker run --rm --network=naq\ --name keycloak_exporter\ -v /tmp:/tmp/keycloak-export\ -e POSTGRES_DATABASE=keycloak\ -e POSTGRES_PASSWORD=password\ -e POSTGRES_USER=keycloak\ -e DB_VENDOR=POSTGRES\ -e POSTGRES_PORT_5432_TCP_ADDR=keycloakdb\ jboss/keycloak:3.4.3.Final\ -Dkeycloak.migration.action=export\ -Dkeycloak.migration.provider=dir\ -Dkeycloak.migration.dir=/tmp/keycloak-export\ -Dkeycloak.migration.usersExportStrategy=SAME_FILE\ -Dkeycloak.migration.realmName=Naq\
You'll then find export files in the /tmp dir on your host.