Docker build for running a jenkins server behind nginx (w/ google oAuth as authentication) docker-in-docker is available so Jenkins can launch dockerized builds
The docker container will run the supervisor daemon on startup (through /scripts/start.sh
).
Supervisor will start all processes as defined in ./conf/supervisor
, which includes jenkins
, nginx
and docker
The nginx variables are dynamically populated upon container startup. All available environment variables passed to the docker container
with the prefix NGINX_
will be available inside the nginx server configuration. These allow the nginx configuration to be dynamically
populated at run time, so proxy endpoints for example can be modified dynamically.
See run example below for how to pass an env file on run time.
See the nginx config readme for more details
Inside any of the subcontainers, run
docker build -t jenkins-nginx ./
where -t is the tag name we give the container
To enable DIND, we need to run the container in privileged mode. To run the container, execute
docker run --privileged --dns 8.8.8.8 -d -p 80:80 -p 443:443 -v ~/jenkins_home:/var/jenkins_home --env-file ~/.jenkins_env --name jenkins-nginx jenkins-nginx
-p
here is binding to the usual 80/443 ports-v
param maps internal jenkins_home volume to a folder on host.--env-file
sources the environment variables from the provided file