Deployed 9b998fb with MkDocs version: 1.1.2

This commit is contained in:
2020-12-20 17:27:19 +00:00
parent 53c402703e
commit 1731302145
36 changed files with 978 additions and 899 deletions

View file

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/private-registries/">
<link rel="shortcut icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.0.1">
<link rel="shortcut icon" href="../images/favicon.ico">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.1.7">
@ -19,10 +20,10 @@
<link rel="stylesheet" href="../assets/stylesheets/main.38780c08.min.css">
<link rel="stylesheet" href="../assets/stylesheets/main.19753c6b.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.3f72e892.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.196e0c26.min.css">
@ -37,6 +38,8 @@
<link rel="stylesheet" href="../stylesheets/theme.css">
@ -49,7 +52,7 @@
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
<body dir="ltr" data-md-color-scheme="containrrr" data-md-color-primary="" data-md-color-accent="">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
@ -67,12 +70,13 @@
</div>
<header class="md-header" data-md-component="header">
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href="http://containrrr.github.io/watchtower/" title="Watchtower" class="md-header-nav__button md-logo" aria-label="Watchtower">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
<img src="../images/logo-450px.png" alt="logo">
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
@ -101,7 +105,7 @@
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
@ -152,12 +156,13 @@
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="http://containrrr.github.io/watchtower/" title="Watchtower" class="md-nav__button md-logo" aria-label="Watchtower">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
<img src="../images/logo-450px.png" alt="logo">
</a>
Watchtower
@ -184,7 +189,7 @@
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
<a href=".." class="md-nav__link">
Home
</a>
</li>
@ -196,7 +201,7 @@
<li class="md-nav__item">
<a href="../introduction/" title="Introduction" class="md-nav__link">
<a href="../introduction/" class="md-nav__link">
Introduction
</a>
</li>
@ -208,7 +213,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -220,7 +225,7 @@
<li class="md-nav__item">
<a href="../arguments/" title="Arguments" class="md-nav__link">
<a href="../arguments/" class="md-nav__link">
Arguments
</a>
</li>
@ -232,7 +237,7 @@
<li class="md-nav__item">
<a href="../notifications/" title="Notifications" class="md-nav__link">
<a href="../notifications/" class="md-nav__link">
Notifications
</a>
</li>
@ -244,7 +249,7 @@
<li class="md-nav__item">
<a href="../container-selection/" title="Container selection" class="md-nav__link">
<a href="../container-selection/" class="md-nav__link">
Container selection
</a>
</li>
@ -264,7 +269,7 @@
<a href="./" title="Private registries" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Private registries
</a>
@ -277,7 +282,7 @@
<li class="md-nav__item">
<a href="../linked-containers/" title="Linked containers" class="md-nav__link">
<a href="../linked-containers/" class="md-nav__link">
Linked containers
</a>
</li>
@ -289,7 +294,7 @@
<li class="md-nav__item">
<a href="../remote-hosts/" title="Remote hosts" class="md-nav__link">
<a href="../remote-hosts/" class="md-nav__link">
Remote hosts
</a>
</li>
@ -301,7 +306,7 @@
<li class="md-nav__item">
<a href="../secure-connections/" title="Secure connections" class="md-nav__link">
<a href="../secure-connections/" class="md-nav__link">
Secure connections
</a>
</li>
@ -313,7 +318,7 @@
<li class="md-nav__item">
<a href="../stop-signals/" title="Stop signals" class="md-nav__link">
<a href="../stop-signals/" class="md-nav__link">
Stop signals
</a>
</li>
@ -325,7 +330,7 @@
<li class="md-nav__item">
<a href="../lifecycle-hooks/" title="Lifecycle hooks" class="md-nav__link">
<a href="../lifecycle-hooks/" class="md-nav__link">
Lifecycle hooks
</a>
</li>
@ -337,7 +342,7 @@
<li class="md-nav__item">
<a href="../running-multiple-instances/" title="Running multiple instances" class="md-nav__link">
<a href="../running-multiple-instances/" class="md-nav__link">
Running multiple instances
</a>
</li>
@ -387,20 +392,20 @@ There are two ways to generate this configuration file:</p>
<h3 id="create_the_configuration_file_manually">Create the configuration file manually<a class="headerlink" href="#create_the_configuration_file_manually" title="Permanent link">&para;</a></h3>
<p>Create a new configuration file with the following syntax and a base64 encoded username and
password <code>auth</code> string:</p>
<pre><code class="json">{
&quot;auths&quot;: {
&quot;&lt;REGISTRY_NAME&gt;&quot;: {
&quot;auth&quot;: &quot;XXXXXXX&quot;
}
}
}
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;auths&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;&lt;REGISTRY_NAME&gt;&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;auth&quot;</span><span class="p">:</span> <span class="s2">&quot;XXXXXXX&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p><code>&lt;REGISTRY_NAME&gt;</code> needs to be replaced by the name of your private registry
(e.g., <code>my-private-registry.example.org</code>)</p>
<p>The required <code>auth</code> string can be generated as follows:</p>
<pre><code class="bash">echo -n 'username:password' | base64
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nb">echo</span> -n <span class="s1">&#39;username:password&#39;</span> <span class="p">|</span> base64
</code></pre></div>
<blockquote>
<h3 id="i_username_and_password_for_gcloud"> Username and Password for GCloud<a class="headerlink" href="#i_username_and_password_for_gcloud" title="Permanent link">&para;</a></h3>
@ -411,8 +416,8 @@ echo -n "_json_key:$(cat gcloudauth.json)" | base64 -w0</code>
When the watchtower Docker container is started, the created configuration file
(<code>&lt;PATH&gt;/config.json</code> in this example) needs to be passed to the container:</p>
</blockquote>
<pre><code class="bash">docker run [...] -v &lt;PATH&gt;/config.json:/config.json containrrr/watchtower
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run <span class="o">[</span>...<span class="o">]</span> -v &lt;PATH&gt;/config.json:/config.json containrrr/watchtower
</code></pre></div>
<h3 id="share_the_docker_configuration_file">Share the Docker configuration file<a class="headerlink" href="#share_the_docker_configuration_file" title="Permanent link">&para;</a></h3>
<p>To pull an image from a private registry, <code>docker login</code> needs to be called first, to get access
@ -420,34 +425,34 @@ to the registry. The provided credentials are stored in a configuration file cal
This configuration file can be directly used by watchtower. In this case, the creation of an
additional configuration file is not necessary.</p>
<p>When the Docker container is started, pass the configuration file to watchtower:</p>
<pre><code class="bash">docker run [...] -v &lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json containrrr/watchtower
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run <span class="o">[</span>...<span class="o">]</span> -v &lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json containrrr/watchtower
</code></pre></div>
<p>When creating the watchtower container via docker-compose, use the following lines:</p>
<pre><code class="yaml">version: &quot;3.4&quot;
services:
watchtower:
image: index.docker.io/containrrr/watchtower:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- &lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json
...
</code></pre>
<div class="codehilite"><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="nt">watchtower</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">index.docker.io/containrrr/watchtower:latest</span>
<span class="nt">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>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">&lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json</span>
<span class="l l-Scalar l-Scalar-Plain">...</span>
</code></pre></div>
<h4 id="docker_config_path">Docker Config path<a class="headerlink" href="#docker_config_path" title="Permanent link">&para;</a></h4>
<p>By default, watchtower will look for the <code>config.json</code> file in <code>/</code>, but this can be changed by setting the <code>DOCKER_CONFIG</code> environment variable to the directory path where your config is located. This is useful for setups where the config.json file is changed while the watchtower instance is running, as the changes will not be picked up for a mounted file if the inode changes.
Example usage:</p>
<pre><code class="yaml">version: &quot;3.4&quot;
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.4&quot;</span>
services:
watchtower:
image: containrrr/watchtower
environment:
DOCKER_CONFIG: /config
volumes:
- /etc/watchtower/config/:/config/
- /var/run/docker.sock:/var/run/docker.sock
</code></pre>
<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="l l-Scalar l-Scalar-Plain">containrrr/watchtower</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="nt">DOCKER_CONFIG</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">/config</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/watchtower/config/:/config/</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>
<h2 id="credential_helpers">Credential helpers<a class="headerlink" href="#credential_helpers" title="Permanent link">&para;</a></h2>
<p>Some private Docker registries (the most prominent probably being AWS ECR) use non-standard ways of authentication.
@ -461,21 +466,21 @@ in a volume that may be mounted onto your watchtower container.</p>
<ol>
<li>Create the Dockerfile (contents below): </li>
</ol>
<pre><code class="Dockerfile">FROM golang:latest
<div class="codehilite"><pre><span></span><code><span class="k">FROM</span> <span class="s">golang:latest</span>
ENV CGO_ENABLED 0
ENV REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
<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
RUN go get -u $REPO
<span class="k">RUN</span> go get -u <span class="nv">$REPO</span>
RUN rm /go/bin/docker-credential-ecr-login
<span class="k">RUN</span> rm /go/bin/docker-credential-ecr-login
RUN go build \
-o /go/bin/docker-credential-ecr-login \
/go/src/$REPO
<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>
WORKDIR /go/bin/
</code></pre>
<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>
@ -487,47 +492,46 @@ WORKDIR /go/bin/
<p>docker build -t aws-ecr-dock-cred-helper .</p>
<h1 id="build_the_command_and_store_it_in_the_new_volume_in_the_gobin_directory">Build the command and store it in the new volume in the /go/bin directory.<a class="headerlink" href="#build_the_command_and_store_it_in_the_new_volume_in_the_gobin_directory" title="Permanent link">&para;</a></h1>
<p>docker run -d --rm --name aws-cred-helper --volume helper:/go/bin aws-ecr-dock-cred-helper</p>
<pre><code>
3. Create a configuration file for docker, and store it in $HOME/.docker/config.json (replace the &lt;AWS_ACCOUNT_ID&gt;
placeholders with your AWS Account ID):
<div class="codehilite"><pre><span></span><code><span class="mi">3</span><span class="p">.</span> <span class="k">Create</span> <span class="n">a</span> <span class="n">configuration</span> <span class="n">file</span> <span class="k">for</span> <span class="n">docker</span><span class="p">,</span> <span class="k">and</span> <span class="n">store</span> <span class="n">it</span> <span class="k">in</span> <span class="err">$</span><span class="n">HOME</span><span class="o">/</span><span class="p">.</span><span class="n">docker</span><span class="o">/</span><span class="n">config</span><span class="p">.</span><span class="n">json</span> <span class="p">(</span><span class="k">replace</span> <span class="n">the</span> <span class="o">&lt;</span><span class="n">AWS_ACCOUNT_ID</span><span class="o">&gt;</span>
<span class="n">placeholders</span> <span class="k">with</span> <span class="n">your</span> <span class="n">AWS</span> <span class="n">Account</span> <span class="n">ID</span><span class="p">):</span>
```json
{
&quot;credsStore&quot; : &quot;ecr-login&quot;,
&quot;HttpHeaders&quot; : {
&quot;User-Agent&quot; : &quot;Docker-Client/19.03.1 (XXXXXX)&quot;
},
&quot;auths&quot; : {
&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot; : {}
},
&quot;credHelpers&quot;: {
&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot; : &quot;ecr-login&quot;
}
}
</code></pre>
<span class="o">```</span><span class="n">json</span>
<span class="err">{</span>
<span class="ss">&quot;credsStore&quot;</span> <span class="p">:</span> <span class="ss">&quot;ecr-login&quot;</span><span class="p">,</span>
<span class="ss">&quot;HttpHeaders&quot;</span> <span class="p">:</span> <span class="err">{</span>
<span class="ss">&quot;User-Agent&quot;</span> <span class="p">:</span> <span class="ss">&quot;Docker-Client/19.03.1 (XXXXXX)&quot;</span>
<span class="err">}</span><span class="p">,</span>
<span class="ss">&quot;auths&quot;</span> <span class="p">:</span> <span class="err">{</span>
<span class="ss">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="err">{}</span>
<span class="err">}</span><span class="p">,</span>
<span class="ss">&quot;credHelpers&quot;</span><span class="p">:</span> <span class="err">{</span>
<span class="ss">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="ss">&quot;ecr-login&quot;</span>
<span class="err">}</span>
<span class="err">}</span>
</code></pre></div>
<ol>
<li>Create a docker-compose file (as an example) to help launch the container:</li>
</ol>
<p>and the docker-compose definition:</p>
<pre><code class="yaml">version: &quot;3.4&quot;
services:
# Check for new images and restart things if a new image exists
# for any of our containers.
watchtower:
image: containrrr/watchtower:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .docker/config.json:/config.json
- helper:/go/bin
environment:
- HOME=/
- PATH=$PATH:/go/bin
- AWS_REGION=us-west-1
volumes:
helper:
external: true
</code></pre>
<div class="codehilite"><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>
<span class="nt">watchtower</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">containrrr/watchtower:latest</span>
<span class="nt">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>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">.docker/config.json:/config.json</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">helper:/go/bin</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">HOME=/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PATH=$PATH:/go/bin</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">AWS_REGION=us-west-1</span>
<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>
<p>A few additional notes:</p>
<ol>
@ -558,7 +562,7 @@ volumes:
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../container-selection/" title="Container selection" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../container-selection/" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
@ -573,7 +577,7 @@ volumes:
</a>
<a href="../linked-containers/" title="Linked containers" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../linked-containers/" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
@ -606,8 +610,8 @@ volumes:
</div>
<script src="../assets/javascripts/vendor.77e55a48.min.js"></script>
<script src="../assets/javascripts/bundle.aa3f9871.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
<script src="../assets/javascripts/vendor.0ac82a11.min.js"></script>
<script src="../assets/javascripts/bundle.f81dfb4d.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
<script>
app = initialize({