<p>With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.</p>
<p>For example, let's say you were running watchtower along with an instance of <em>centurylink/wetty-cli</em> image:</p>
<pre><codeclass="bash">$ docker ps
CONTAINER ID IMAGE STATUS PORTS NAMES
967848166a45 centurylink/wetty-cli Up 10 minutes 0.0.0.0:8080->3000/tcp wetty
6cc4d2a9d1a5 containrrr/watchtower Up 15 minutes watchtower
</code></pre>
<p>Every few minutes watchtower will pull the latest <em>centurylink/wetty-cli</em> image and compare it to the one that was used to run the "wetty" container. If it sees that the image has changed it will stop/remove the "wetty" container and then restart it using the new image and the same <code>docker run</code> options that were used to start the container initially (in this case, that would include the <code>-p 8080:3000</code> port mapping).</p></article></div></div></main><footerclass="md-footer"><divclass="md-footer-nav"><navclass="md-footer-nav__inner md-grid"><ahref=".."title="Home"class="md-flex md-footer-nav__link md-footer-nav__link--prev"rel="prev"><divclass="md-flex__cell md-flex__cell--shrink"><iclass="md-icon md-icon--arrow-back md-footer-nav__button"></i></div><divclass="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><spanclass="md-flex__ellipsis"><spanclass="md-footer-nav__direction">Previous</span>Home</span></div></a><ahref="../usage-overview/"title="Usage overview"class="md-flex md-footer-nav__link md-footer-nav__link--next"rel="next"><divclass="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><spanclass="md-flex__ellipsis"><spanclass="md-footer-nav__direction">Next</span>Usage overview</span></div><divclass="md-flex__cell md-flex__cell--shrink"><iclass="md-icon md-icon--arrow-forward md-footer-nav__button"></i></div></a></nav></div><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass="md-footer-copyright">powered by <ahref="https://www.mkdocs.org">MkDocs</a> and <ahref="https://squidfunk.github.io/mkdocs-material/">Material for MkDocs</a></div></div></div></footer></div><scriptsrc="../assets/javascripts/application.b260a35d.js"></script><script>app.initialize({version:"1.0.4",url:{base:".."}})</script></body></html>