Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ContainerLabels.md

Chris edited this pageJun 22, 2025 ·9 revisions

Container Labels

Docker labels are the primary mechanism for instructing DockFlare which containers to expose and how to configure them. By reading these labels, DockFlare automates the creation of DNS records, Cloudflare Tunnel ingress rules, and Zero Trust Access policies.

Label Prefix

DockFlare looks for labels starting with a specific prefix.

  • Default Prefix:dockflare.
  • Custom Prefix: You can change this using theLABEL_PREFIXenvironment variable.

In the examples below, the default prefixdockflare. is used. If you set a custom prefix (e.g.,LABEL_PREFIX=cf.ingress), replacedockflare. withcf.ingress. in your labels. Note that the trailing dot is handled automatically.


Ingress Configuration Labels

These labels define the public endpoint and how Cloudflare connects to your internal service.

LabelDescriptionRequiredExample
{prefix}.enableMust be set to"true" for DockFlare to manage this container.Yesdockflare.enable="true"
{prefix}.hostnameThe public hostname you want to use. Must be within a zone managed by your Cloudflare account.Yesdockflare.hostname="app.example.com"
{prefix}.serviceThe internal network address of the service. Format:protocol://host:port. Valid protocols:http,httpss,tcp,ssh,rdp,http_status.Yesdockflare.service="http://my-app:80"
{prefix}.pathA URL path for this rule. If set, only requests to{hostname}/{path} will match this rule.Nodockflare.path="/api"
{prefix}.zonenameSpecifies the Cloudflare zone (e.g.,example.com) for thehostname, overriding the globalCF_ZONE_ID.Nodockflare.zonename="other-domain.org"
{prefix}.no_tls_verifyIf"true", Cloudflare will not verify the TLS certificate of an HTTPS origin. Useful for self-signed certificates.Nodockflare.no_tls_verify="true"
{prefix}.originsrvnameThe Server Name Indication (SNI) Cloudflare should use for the TLS handshake with an HTTPS origin.Nodockflare.originsrvname="internal.local"

Basic Ingress Example:

services:my-app:image:nginxlabels:      -"dockflare.enable=true"      -"dockflare.hostname=my-app.example.com"      -"dockflare.service=http://my-app:80"

Access Policy Labels (Zero Trust)

These labels define the initial Cloudflare Access Policy for the endpoint.Note: These can be overridden by changes made in the DockFlareWeb UI.

LabelDescriptionDefaultExample
{prefix}.access.policySets the policy type. Common values:bypass (public),authenticate (login required),default_tld (inherits from a*.yourdomain.com policy). If unset, no Access App is created.(None)dockflare.access.policy="authenticate"
{prefix}.access.nameA custom name for the Cloudflare Access Application.DockFlare-{hostname}dockflare.access.name="My Web App"
{prefix}.access.session_durationThe session duration for the Access Application (e.g.,24h,30m).24hdockflare.access.session_duration="8h"
{prefix}.access.app_launcher_visibleIf"true", the app appears in the Cloudflare App Launcher.falsedockflare.access.app_launcher_visible="true"
{prefix}.access.allowed_idpsA comma-separated list of allowed Identity Provider (IdP) UUIDs.(All)dockflare.access.allowed_idps="<IdP_UUID>"
{prefix}.access.custom_rulesA JSON string representing an array of Access Policy rules. Overrides theaccess.policy setting.(None)dockflare.access.custom_rules='[{"email":{"email":"user@example.com"},"action":"allow"}]'

Example with an Access Policy:

services:secure-app:image:some-private-applabels:      -"dockflare.enable=true"      -"dockflare.hostname=secure.example.com"      -"dockflare.service=http://secure-app:8080"# Secure this service with Cloudflare Access      -"dockflare.access.policy=authenticate"      -"dockflare.access.session_duration=1h"

Indexed Labels for Multiple Rules

To define multiple, distinct rules from a single container, use indexed labels. Each index (0,1,2, etc.) creates a completely separate rule.

  • An indexed setting (e.g.,{prefix}.0.path) always overrides a default, non-indexed setting ({prefix}.path) for that specific rule.
  • If an indexed rule omits a setting (e.g.,{prefix}.0.path is not set), it will fall back to the default non-indexed version if it exists.

Example of Indexed Labels:

services:multi-service-gateway:image:nginxlabels:      -"dockflare.enable=true"# --- Rule 0: The API ---      -"dockflare.0.hostname=api.example.com"      -"dockflare.0.service=http://multi-service-gateway:80"      -"dockflare.0.access.policy=authenticate"# API is secure# --- Rule 1: The Public Website ---      -"dockflare.1.hostname=www.example.com"      -"dockflare.1.service=http://multi-service-gateway:80"# No access.policy label, so this rule will be public.

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp