Skip to content

Commit

Permalink
Add a sample of MC with built-in user
Browse files Browse the repository at this point in the history
  • Loading branch information
puzpuzpuz committed Feb 12, 2019
1 parent 9c0d390 commit 384ee92
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
17 changes: 17 additions & 0 deletions management-center-built-in-user/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM hazelcast/management-center:latest

# override start command for Management Center
CMD ["bash", "-c", "set -euo pipefail \
# define a built-in user account on first start
&& [ -f ${MC_DATA}/security.properties ] || ${MC_HOME}/mc-cli.sh create-user -H=${MC_DATA} -n=admin -p=p@ssw0rd -r=admin \
&& if [[ \"x${JAVA_OPTS}\" != \"x\" ]]; then export JAVA_OPTS=\"${JAVA_OPTS_DEFAULT} ${JAVA_OPTS}\"; else export JAVA_OPTS=\"${JAVA_OPTS_DEFAULT}\"; fi \
&& if [[ \"x${MIN_HEAP_SIZE}\" != \"x\" ]]; then export JAVA_OPTS=\"${JAVA_OPTS} -Xms${MIN_HEAP_SIZE}\"; fi \
&& if [[ \"x${MAX_HEAP_SIZE}\" != \"x\" ]]; then export JAVA_OPTS=\"${JAVA_OPTS} -Xms${MAX_HEAP_SIZE}\"; fi \
&& echo \"########################################\" \
&& echo \"# JAVA_OPTS=${JAVA_OPTS}\" \
&& echo \"# starting now....\" \
&& echo \"########################################\" \
&& set -x \
&& exec java -server ${JAVA_OPTS} -jar ${MC_RUNTIME} \
${MC_HTTP_PORT} ${MC_HTTPS_PORT} ${MC_CONTEXT} \
"]
33 changes: 33 additions & 0 deletions management-center-built-in-user/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Hazelcast Management Center With Built-In User Sample

In this repository, you can find a sample Docker image for Hazelcast Management Center with a built-in user account.

## Prerequisites

You should have installed Docker on your System.

## How to Build and Run Sample Image

1. Clone repo into the local.

`git clone https://github.com/hazelcast/hazelcast-docker-samples.git`

2. Go to directory;

`cd hazelcast-docker-samples/management-center-built-in-user/`

3. Build the image using the Docker command.

`docker build -t mc-built-in-user .`

4. Launch a container using the Docker command.

`docker run -p 8080:8080 mc-built-in-user`

5. Open a browser and enter:

`http://localhost:8080/hazelcast-mancenter`

5. Login with this credentials:

Username: `admin` Password: `p@ssw0rd`

0 comments on commit 384ee92

Please sign in to comment.