I run Jenkins and my app is dockerized, i.e. when I run the container it exposes port 3000 and I can point my browser there. On every Github PR I would like to deploy that git commit to a running container somewhere and have Jenkins post back to the PR the link where it can be accessed. On any PR updates it gets auto re-deployed and on PR close/resolve it gets torn down.
I have looked at kubernetes and a little rancher, but what's the easiest way to get this going assuming I can only deploy to one box?
The Docker platform Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allows you to run many containers simultaneously on a given host.
There is a jenkins plugin github-pullrequest can resolve your problem.
Prerequisites:
Please follow the guide configuration to setup your jenkins integration with github.
After configuration:
About expose port of cotainer with multi PR, your can just run container with -p 3000
, it will auto expose a port in a range on the docker host, docker port <container>
will show the specific port number, so for example:
container1
with address <host>:32667
for PR1
container2
with address <host>:35989
for PR2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With