Created
October 1, 2015 17:22
-
-
Save sirkkalap/a2c1459f2faa13bfcae7 to your computer and use it in GitHub Desktop.
Set up very minimal docker environment to serve demo / development environment for projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| yum update | |
| curl -sSL https://get.docker.com/ | sh | |
| service docker start | |
| # Front reverse proxy with virtual host autoconfiguration | |
| # *** Privileged docker container *** | |
| docker run -d -p 80:80 \ | |
| -v /var/run/docker.sock:/tmp/docker.sock:ro \ | |
| jwilder/nginx-proxy | |
| # Generate html content for demo | |
| mkdir -p /demo/html && \ | |
| echo '<html><body>Hello, world!</body></html>' >/demo/html/index.html | |
| # Demo container nginx "Hello, world!" | |
| docker run --name demo \ | |
| -e VIRTUAL_HOST=demo.xxxxx.yyy \ | |
| -v /demo/html:/usr/share/nginx/html:ro -d nginx | |
| # Jenkins master | |
| docker run -d --name jenkins-master \ | |
| -e VIRTUAL_HOST=jenkins.xxxxx.yyy \ | |
| -e VIRTUAL_PORT=8080 \ | |
| -e "JAVA_OPTS=-Duser.timezone=EET -Dfile.encoding=UTF8" \ | |
| -p 8080:8080 -p 50000:50000 \ | |
| sirkkalap/jenkins-swarm-w-git-manual:latest | |
| # Note, you need to have DNS cname binding *.xxxxx.yyy to the server, or edit every client /etc/hosts accordingly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment