As of May 2021, this project has been deprecated and is now archived in favor of using vela
-
Where to get help: The Jenkins users google group or Stack Overflow
-
Where to get background information: The Target tech blog
-
Where to file issues: https://github.com/target/jenkins-docker-nginx/issues
-
Maintained by: The JAYS Maintainers
Out-of-the-box, Nginx doesn't support using environment variables inside most configuration blocks. We will be using envsubst to replace variables within the default.conf.template and index.html.template files.
This is done by using CMD /wrapper.sh
inside of the Dockerfile. The wrapper.sh is a simple shell script that calls envsubst
to replace $DOMAIN
and $SUB_DOMAIN
with the values of environment variables that you define.
You can simply modify configuration files via reusing the docker image, for example:
FROM target/jenkins-docker-nginx
COPY <my default template> /etc/nginx/conf.d/default.conf.template
- Existing Docker Swarm cluster with version >=
1.13
- Overlay network named
jenkins
- Using Docker secrets for ssl certificates
The following steps need to be done on a Docker Swarm manager
-
Create a Docker swarm overlay network with:
docker network create --driver overlay --subnet <Subnet in CIDR format> jenkins
-
Create Docker secrets
docker secret create cert.crt <path to certificate> docker secret create cert.key <path to key>
-
Modify the
docker-compose.yml
file to have company specific settings -
Create a docker stack
docker stack deploy -c docker-compose.yml service