mirror of
https://github.com/bitnami/containers.git
synced 2026-10-17 14:34:34 +02:00
[bitnami/jenkins] add support for custom Jenkins launcher parameters (#30852)
* feat: add support for custom Jenkins launcher parameters with JENKINS_OPTS variable Signed-off-by: Haoming Zhu <azhu00@gmail.com> * fix: add JENKINS_OPTS variable for jenkins-env.sh Signed-off-by: Haoming Zhu <azhu00@gmail.com> * doc: Add an example for JENKINS_OPTS env Signed-off-by: Haoming Zhu <azhu00@gmail.com> * fix: change jenkins-env.sh comment for JENKINS_OPTS Signed-off-by: Haoming Zhu <azhu00@gmail.com> * fix: add JENKINS_OPTS inside jenkins_env_vars in jenkins-env.sh Signed-off-by: Haoming Zhu <azhu00@gmail.com> --------- Signed-off-by: Haoming Zhu <azhu00@gmail.com>
This commit is contained in:
@@ -47,6 +47,7 @@ jenkins_env_vars=(
|
||||
JENKINS_EMAIL
|
||||
JENKINS_SWARM_USERNAME
|
||||
JENKINS_SWARM_PASSWORD
|
||||
JENKINS_OPTS
|
||||
JAVA_HOME
|
||||
JAVA_OPTS
|
||||
DISABLE_JENKINS_INITIALIZATION
|
||||
@@ -115,6 +116,9 @@ export JENKINS_EMAIL="${JENKINS_EMAIL:-user@example.com}" # only used during the
|
||||
export JENKINS_SWARM_USERNAME="${JENKINS_SWARM_USERNAME:-swarm}" # only used during the first initialization
|
||||
export JENKINS_SWARM_PASSWORD="${JENKINS_SWARM_PASSWORD:-}" # only used during the first initialization
|
||||
|
||||
# Jenkins launcher parameters
|
||||
export JENKINS_OPTS="${JENKINS_OPTS:-}"
|
||||
|
||||
# Java configuration
|
||||
export JAVA_HOME="${JAVA_HOME:-${BITNAMI_ROOT_DIR}/java}"
|
||||
export JAVA_OPTS="${JAVA_OPTS:-}"
|
||||
|
||||
@@ -38,6 +38,10 @@ else
|
||||
"--httpsKeyStorePassword=${JENKINS_KEYSTORE_PASSWORD}"
|
||||
)
|
||||
fi
|
||||
if [[ -n "${JENKINS_OPTS:-}" ]]; then
|
||||
read -r -a jenkins_opts <<<"$JENKINS_OPTS"
|
||||
args+=("${jenkins_opts[@]}")
|
||||
fi
|
||||
args+=("$@")
|
||||
|
||||
info "** Starting Jenkins **"
|
||||
|
||||
@@ -188,6 +188,10 @@ Available environment variables:
|
||||
|
||||
* `JAVA_OPTS`: Customize JVM parameters. No defaults.
|
||||
|
||||
#### JENKINS configuration
|
||||
|
||||
* `JENKINS_OPTS`: Customize Jenkins launcher parameters. No defaults.
|
||||
|
||||
## Logging
|
||||
|
||||
The Bitnami Jenkins Docker image sends the container logs to `stdout`. To view the logs:
|
||||
@@ -318,6 +322,16 @@ docker run -d --name jenkins -p 80:8080 \
|
||||
bitnami/jenkins:latest
|
||||
```
|
||||
|
||||
### Configuring reverse proxy
|
||||
|
||||
If you need to install Jenkins behind a reverse proxy with a prefix, such as mycompany.com/jenkins, you can use the "JENKINS_OPTS" environment variable for this purpose:
|
||||
|
||||
```console
|
||||
docker run -d --name jenkins -p 8080:8080 \
|
||||
--env JENKINS_OPTS="--prefix=/jenkins" \
|
||||
bitnami/jenkins:latest
|
||||
```
|
||||
|
||||
### Skipping Bitnami initialization
|
||||
|
||||
By default, when running this image, Bitnami implement some logic in order to configure it for working out of the box. This initialization consists of creating the user and password, preparing data to persist, configuring permissions, creating the `JENKINS_HOME`, etc. You can skip it in two ways:
|
||||
|
||||
Reference in New Issue
Block a user