Deployed 247baf5 with MkDocs version: 1.1.2

gh-pages
5 years ago
parent e7c07c8ba8
commit 670ba26f36

@ -483,7 +483,7 @@
<p style="text-align: center; margin-left: 1.6rem;">
<img src="./images/logo-450px.png" width="450" />
<img alt="Logotype depicting a lighthouse" src="./images/logo-450px.png" width="450" />
</p>
<h1 align="center">
Watchtower
@ -529,19 +529,22 @@
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. Run the watchtower container with
the following command:</p>
<div class="tabbed-set" data-tabs="1:1"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><label for="__tabbed_1_1">docker run</label><div class="tabbed-content"></div>
</div>
<p>```bash $ docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
<div class="tabbed-set" data-tabs="1:2"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><label for="__tabbed_1_1">docker run</label><div class="tabbed-content">
<div class="highlight"><pre><span></span><code>$ docker run -d <span class="se">\</span>
--name watchtower <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
containrrr/watchtower
<div class="highlight"><pre><span></span><code>=== &quot;docker-compose.yml&quot;
```yaml version: &quot;3&quot;
services:
watchtower:
image: containrrr/watchtower volumes:
- /var/run/docker.sock:/var/run/docker.sock
</code></pre></div></p>
</code></pre></div>
</div>
<input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><label for="__tabbed_1_2">docker-compose.yml</label><div class="tabbed-content">
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3&quot;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="nt">watchtower</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="nt">containrrr/watchtower volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/var/run/docker.sock:/var/run/docker.sock</span>
</code></pre></div>
</div>
</div>

@ -611,19 +611,22 @@ executable.</p>
</table>
<p>These labels can be declared as instructions in a Dockerfile (with some example .sh files) or be specified as part of
the <code>docker run</code> command line:</p>
<div class="tabbed-set" data-tabs="1:1"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><label for="__tabbed_1_1">Dockerfile</label><div class="tabbed-content"></div>
<div class="tabbed-set" data-tabs="1:2"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><label for="__tabbed_1_1">Dockerfile</label><div class="tabbed-content">
<div class="highlight"><pre><span></span><code><span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.pre-check<span class="o">=</span><span class="s2">&quot;/sync.sh&quot;</span>
<span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.pre-update<span class="o">=</span><span class="s2">&quot;/dump-data.sh&quot;</span>
<span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.post-update<span class="o">=</span><span class="s2">&quot;/restore-data.sh&quot;</span>
<span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.post-check<span class="o">=</span><span class="s2">&quot;/send-heartbeat.sh&quot;</span>
</code></pre></div>
</div>
<input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><label for="__tabbed_1_2">docker run</label><div class="tabbed-content">
<div class="highlight"><pre><span></span><code>docker run -d <span class="se">\</span>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.pre-check<span class="o">=</span><span class="s2">&quot;/sync.sh&quot;</span> <span class="se">\</span>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.pre-update<span class="o">=</span><span class="s2">&quot;/dump-data.sh&quot;</span> <span class="se">\</span>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.post-update<span class="o">=</span><span class="s2">&quot;/restore-data.sh&quot;</span> <span class="se">\</span>
someimage --label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.post-check<span class="o">=</span><span class="s2">&quot;/send-heartbeat.sh&quot;</span> <span class="se">\</span>
</code></pre></div>
</div>
</div>
<p>```docker LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="/sync.sh"
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="/dump-data.sh"
LABEL com.centurylinklabs.watchtower.lifecycle.post-update="/restore-data.sh"
LABEL com.centurylinklabs.watchtower.lifecycle.post-check="/send-heartbeat.sh"
<div class="highlight"><pre><span></span><code>=== &quot;docker run&quot;
```bash docker run -d \
--label=com.centurylinklabs.watchtower.lifecycle.pre-check=&quot;/sync.sh&quot; \
--label=com.centurylinklabs.watchtower.lifecycle.pre-update=&quot;/dump-data.sh&quot; \
--label=com.centurylinklabs.watchtower.lifecycle.post-update=&quot;/restore-data.sh&quot; \
someimage --label=com.centurylinklabs.watchtower.lifecycle.post-check=&quot;/send-heartbeat.sh&quot; \
</code></pre></div></p>
<h3 id="timeouts">Timeouts<a class="headerlink" href="#timeouts" title="Permanent link">&para;</a></h3>
<p>The timeout for all lifecycle commands is 60 seconds. After that, a timeout will
occur, forcing Watchtower to continue the update loop.</p>

@ -641,9 +641,9 @@ helper in a separate container and mount it using volumes.</p>
<p>Use the dockerfile below to build the <a href="https://github.com/awslabs/amazon-ecr-credential-helper">amazon-ecr-credential-helper</a>,
in a volume that may be mounted onto your watchtower container.</p>
<ol>
<li>Create the Dockerfile (contents below):</li>
</ol>
<div class="highlight"><pre><span></span><code><span class="k">FROM</span> <span class="s">golang:latest</span>
<li>
<p>Create the Dockerfile (contents below):
<div class="highlight"><pre><span></span><code><span class="k">FROM</span> <span class="s">golang:latest</span>
<span class="k">ENV</span> CGO_ENABLED <span class="m">0</span>
<span class="k">ENV</span> REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
@ -653,44 +653,45 @@ in a volume that may be mounted onto your watchtower container.</p>
<span class="k">RUN</span> rm /go/bin/docker-credential-ecr-login
<span class="k">RUN</span> go build <span class="se">\</span>
-o /go/bin/docker-credential-ecr-login <span class="se">\</span>
/go/src/<span class="nv">$REPO</span>
-o /go/bin/docker-credential-ecr-login <span class="se">\</span>
/go/src/<span class="nv">$REPO</span>
<span class="k">WORKDIR</span><span class="s"> /go/bin/</span>
</code></pre></div>
<ol>
<li>Use the following commands to build the aws-ecr-dock-cred-helper and store it's output in a volume:</li>
</ol>
<div class="highlight"><pre><span></span><code><span class="c1"># Create a volume to store the command (once built)</span>
</code></pre></div></p>
</li>
<li>
<p>Use the following commands to build the aws-ecr-dock-cred-helper and store it's output in a volume:
<div class="highlight"><pre><span></span><code><span class="c1"># Create a volume to store the command (once built)</span>
docker volume create helper
<span class="c1"># Build the container</span>
docker build -t aws-ecr-dock-cred-helper .
<span class="c1"># Build the command and store it in the new volume in the /go/bin directory.</span>
docker run -d --rm --name aws-cred-helper --volume helper:/go/bin aws-ecr-dock-cred-helper
</code></pre></div>
<ol>
<li>Create a configuration file for docker, and store it in $HOME/.docker/config.json (replace the <AWS_ACCOUNT_ID>
placeholders with your AWS Account ID):</li>
</ol>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;credsStore&quot;</span> <span class="p">:</span> <span class="s2">&quot;ecr-login&quot;</span><span class="p">,</span>
<span class="nt">&quot;HttpHeaders&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;User-Agent&quot;</span> <span class="p">:</span> <span class="s2">&quot;Docker-Client/19.03.1 (XXXXXX)&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;auths&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="p">{}</span>
<span class="p">},</span>
<span class="nt">&quot;credHelpers&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="s2">&quot;ecr-login&quot;</span>
<span class="p">}</span>
docker run -d --rm --name aws-cred-helper <span class="se">\</span>
--volume helper:/go/bin aws-ecr-dock-cred-helper
</code></pre></div></p>
</li>
<li>
<p>Create a configuration file for docker, and store it in $HOME/.docker/config.json (replace the <AWS_ACCOUNT_ID>
placeholders with your AWS Account ID):
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;credsStore&quot;</span> <span class="p">:</span> <span class="s2">&quot;ecr-login&quot;</span><span class="p">,</span>
<span class="nt">&quot;HttpHeaders&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;User-Agent&quot;</span> <span class="p">:</span> <span class="s2">&quot;Docker-Client/19.03.1 (XXXXXX)&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;auths&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="p">{}</span>
<span class="p">},</span>
<span class="nt">&quot;credHelpers&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="s2">&quot;ecr-login&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<ol>
</code></pre></div></p>
</li>
<li>
<p>Create a docker-compose file (as an example) to help launch the container:</p>
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.4&quot;</span>
<p>Create a docker-compose file (as an example) to help launch the container:
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.4&quot;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="c1"># Check for new images and restart things if a new image exists</span>
<span class="c1"># for any of our containers.</span>
@ -707,7 +708,7 @@ docker run -d --rm --name aws-cred-helper --volume helper:/go/bin aws-ecr-dock-
<span class="nt">volumes</span><span class="p">:</span>
<span class="nt">helper</span><span class="p">:</span>
<span class="nt">external</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
</code></pre></div>
</code></pre></div></p>
</li>
</ol>
<p>A few additional notes:</p>

File diff suppressed because one or more lines are too long

Binary file not shown.
Loading…
Cancel
Save