docker-documentation/general/fleet/index.html

54 wiersze
53 KiB
HTML
Czysty Zwykły widok Historia

<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Fleet is a web-based image management tool for organisations who ship a large list of Docker images."><meta name=author content=LinuxServer.io><link href=https://docs.linuxserver.io/general/fleet/ rel=canonical><link href=../volumes/ rel=prev><link href=../swag/ rel=next><link rel=icon href="https://gblobscdn.gitbook.com/spaces%2F-LWuIse8qFJj2MqDi90T%2Favatar-1590244439115.png?alt=media"><meta name=generator content="mkdocs-1.4.3, mkdocs-material-9.1.17"><title>Fleet - LinuxServer.io</title><link rel=stylesheet href=../../assets/stylesheets/main.26e3688c.min.css><link rel=stylesheet href=../../assets/stylesheets/palette.ecc896b0.min.css><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=purple data-md-color-accent=indigo> <script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#fleet class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class="md-header md-header--shadow" data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=../.. title=LinuxServer.io class="md-header__button md-logo" aria-label=LinuxServer.io data-md-component=logo> <img src="https://gblobscdn.gitbook.com/spaces%2F-LWuIse8qFJj2MqDi90T%2Favatar-1590244439115.png?alt=media" alt=logo> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> LinuxServer.io </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Fleet </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme=default data-md-color-primary=purple data-md-color-accent=indigo aria-label="Switch to dark mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_2 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg> </label> <input class=md-option data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme=slate data-md-color-primary=purple data-md-color-accent=indigo aria-label="Switch to light mode" type=radio name=__palette id=__palette_2> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3
<span class=w> </span><span class=s2>&quot;status&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;OK&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;data&quot;</span><span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=s2>&quot;totalPullCount&quot;</span><span class=o>:</span><span class=w> </span><span class=mf>1862494227</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;repositories&quot;</span><span class=o>:</span><span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=s2>&quot;lsiobase&quot;</span><span class=o>:</span><span class=w> </span><span class=p>[</span>
<span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=s2>&quot;name&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;alpine&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;pullCount&quot;</span><span class=o>:</span><span class=w> </span><span class=mf>4275970</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;version&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;3.6&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;stable&quot;</span><span class=o>:</span><span class=w> </span><span class=kc>true</span>
<span class=w> </span><span class=p>},</span>
<span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=s2>&quot;name&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;alpine.arm64&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;pullCount&quot;</span><span class=o>:</span><span class=w> </span><span class=mf>66234</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;version&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;edge&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;stable&quot;</span><span class=o>:</span><span class=w> </span><span class=kc>true</span>
<span class=w> </span><span class=p>},</span>
<span class=w> </span><span class=p>...</span>
<span class=w> </span><span class=p>],</span>
<span class=w> </span><span class=s2>&quot;linuxserver&quot;</span><span class=o>:</span><span class=w> </span><span class=p>[</span>
<span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=s2>&quot;name&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;airsonic&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;pullCount&quot;</span><span class=o>:</span><span class=w> </span><span class=mf>4608329</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;version&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;v10.2.1&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;stable&quot;</span><span class=o>:</span><span class=w> </span><span class=kc>true</span>
<span class=w> </span><span class=p>},</span>
<span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=s2>&quot;name&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;apache&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;pullCount&quot;</span><span class=o>:</span><span class=w> </span><span class=mf>3011699</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;version&quot;</span><span class=o>:</span><span class=w> </span><span class=s2>&quot;latest&quot;</span><span class=p>,</span>
<span class=w> </span><span class=s2>&quot;stable&quot;</span><span class=o>:</span><span class=w> </span><span class=kc>true</span>
<span class=w> </span><span class=p>},</span>
<span class=w> </span><span class=p>...</span>
<span class=w> </span><span class=p>]</span>
<span class=w> </span><span class=p>...</span>
<span class=w> </span><span class=p>}</span>
<span class=w> </span><span class=p>}</span>
<span class=p>}</span>
</code></pre></div> <p _=% endapi-method=endapi-method>{% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %}</p> <p _=% endhint=endhint>{% hint style="info" %} Any repositories not synchronized with Docker Hub (e.g. staging or metadata repositories) will not be returned as part of the API. This also applies to images which the repository owner does not wish to be part of the primary image list.</p> <h2 id=running-fleet>Running Fleet</h2> <p _=% endhint=endhint>{% hint style="warning" %} Fleet is a Java application and requires at least JRE 11.</p> <p>Grab the latest Fleet release from <a href=https://github.com/linuxserver/fleet/releases>GitHub</a>.</p> <h3 id=sql>SQL</h3> <p>Fleet stores its data in a MariaDB database which you need to provide. In order for the application to manage its tables and procedures, the user you provide it needs to have the relevant <code>GRANT</code> permissions to the fleet database. The following script should be sufficient to get the initial database set up.</p> <div class=highlight><pre><span></span><code><span class=k>CREATE</span><span class=w> </span><span class=k>SCHEMA</span><span class=w> </span><span class=o>`</span><span class=n>fleet</span><span class=o>`</span><span class=p>;</span>
<span class=k>CREATE</span><span class=w> </span><span class=k>USER</span><span class=w> </span><span class=s1>&#39;fleet_user&#39;</span><span class=w> </span><span class=n>IDENTIFIED</span><span class=w> </span><span class=k>BY</span><span class=w> </span><span class=s1>&#39;supersecretpassword&#39;</span><span class=p>;</span>
<span class=k>GRANT</span><span class=w> </span><span class=k>ALL</span><span class=w> </span><span class=k>ON</span><span class=w> </span><span class=o>`</span><span class=n>fleet</span><span class=o>`</span><span class=p>.</span><span class=o>*</span><span class=w> </span><span class=k>TO</span><span class=w> </span><span class=s1>&#39;fleet_user&#39;</span><span class=p>;</span>
</code></pre></div> <p>The username and password that you define must then be provided as part of Fleet's configuration.</p> <h3 id=configuration-file>Configuration File</h3> <p>All primary configuration for Fleet at runtime is loaded in via a <code>fleet.properties</code> file. This can be located anywhere on the file system, and is loaded in via a Runtime argument:</p> <div class=highlight><pre><span></span><code><span class=c1># Runtime</span>
fleet.app.port<span class=o>=</span><span class=m>8080</span>
<span class=c1># Database Connectivity</span>
fleet.database.driver<span class=o>=</span>org.mariadb.jdbc.Driver
fleet.database.url<span class=o>=</span>jdbc:mariadb://&lt;IP_OR_URL&gt;:3306/fleet
fleet.database.username<span class=o>=</span>&lt;fleet_sql_user&gt;
fleet.database.password<span class=o>=</span>&lt;fleet_sql_password&gt;
<span class=c1># Password security</span>
fleet.admin.secret<span class=o>=</span>&lt;a_random_string&gt;
</code></pre></div> <p>All configuration can be loaded either via the config file, via JVM arguments, or via the system environment. Fleet will first look in the configuration file, then JVM runtime, and finally in the system environment. It will load the first value it finds, which can be useful when needing to override specific properties.</p> <p _=% endhint=endhint>{% hint style="info" %} If you place a property in the system environment, ensure that the property uses underscores rather than periods. This is due to a limitation in BASH environments where exported variables must not contain this character. E.g. <code>fleet.app.port=8080</code> becomes <code>export fleet_app_port=8080</code></p> <table> <thead> <tr> <th align=left>Property Name</th> <th align=left>Purpose</th> </tr> </thead> <tbody> <tr> <td align=left><code>fleet.app.port</code></td> <td align=left>The port which the application will be running under.</td> </tr> <tr> <td align=left><code>fleet.admin.secret</code></td> <td align=left>A string used as part of the password key derivation process. This secret is prepended to the raw password before its key is derived, providing further pseudo-randomness to hashed passwords. <strong>Once set, this must not be changed!</strong> It is vital to remain the same, as it will be used during the password verification step. If Fleet is restarted with this removed or set differently, the password verification process will fail because previously hashed passwords will have been derived with the old secret.</td> </tr> <tr> <td align=left><code>fleet.database.driver</code></td> <td align=left>The driver to use for connections to Fleet's database. This should be <code>org.mariadb.jdbc.Driver</code></td> </tr> <tr> <td align=left><code>fleet.database.url</code></td> <td align=left>The full JDBC connection string to the database.</td> </tr> <tr> <td align=left><code>fleet.database.username</code></td> <td align=left>The username of the SQL user which will be managing the data in the Fleet database. <strong>This should have full GRANT access</strong> to the fleet database as it also manages any database migrations.</td> </tr> <tr> <td align=left><code>fleet.database.password</code></td> <td align=left>The password for the SQL user</td> </tr> </tbody> </table> <h3 id=runtime-arguments>Runtime Arguments</h3> <p>As well as the base configuration file, Fleet also supports some runtime arguments by means of the <code>-D</code> flag. These can be used to direct Fleet to behave in a specific way at runtime.</p> <p _=% endhint=endhint>{% hint style="info" %} Unlike the properties defined above, these properties are only accessed via the JVM arguments (<code>-D</code>).</p> <table> <thead> <tr> <th align=left>Runtime Argument</th> <th align=left>Purpose</th> </tr> </thead> <tbody> <tr> <td align=left><code>fleet.config.base</code></td> <td align=left>The absolute path of the configuration file.</td> </tr> <tr> <td align=left><code>fleet.show.passwords</code></td> <td align=left>Tells fleet to show passwords in plain text in its logs. <strong>Not recommended</strong>.</td> </tr> <tr> <td align=left><code>fleet.nuke.database</code></td> <td align=left><strong>Be very careful.</strong> This will tell Fleet to completely wipe and rebuild its database. This can be useful if the owner deems the database to be too far out of synchronisation with Docker Hub, or if images have since been removed but are still showing in Fleet.</td> </tr> <tr> <td align=left><code>fleet.skip.sync.on.startup</code></td> <td align=left>By default, Fleet will run a synchronisation process when it first starts up. Setting this flag will tell it to skip the first run. The next synchronisation will be at the set interval.</td> </tr> </tbody> </table> <h3 id=default-user>Default User</h3> <p>When starting Fleet for the first time it will create a default user in order for you to log in and manage the repositories/images synchronised by the application. The default username and password are:</p> <p><strong>Username</strong>: admin</p> <p><strong>Password</strong>: a