HiveBrain v1.2.0
Get Started
← Back to all entries
snippetdockerMinor

How to automatically update Docker containers in development?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
updatedockerautomaticallydevelopmenthowcontainers

Problem

What is the best way to use Docker in development so that a container is automatically updated each time you make a change to the codebase?

Solution

An approach I use in both prod and dev is to run a webhook server ( this one is excellent https://github.com/adnanh/webhook ) which is subscribed to listen to the github.com git push events which are published by github

... then when someone does a push to github.com the webhook launches a rebuild script to issue git pull then recomple the code and issue docker build xxx and docker push yyy and docker-compose -f my-file-docker-compose.yaml up ... this all happens on auto pilot ... where I have a running webhook server on a vps box for a given git branch to rebuild its toy domain

this took time to craft however its a life saver

Context

StackExchange DevOps Q#8816, answer score: 3

Revisions (0)

No revisions yet.