专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

wdijkerman/consul Docker 镜像 - 轩辕镜像 | Docker 镜像高效稳定拉取服务

热门搜索:openclaw🔥nginx🔥redis🔥mysqlopenjdkcursorweb2apimemgraphzabbixetcdubuntucorednsjdk
consul
wdijkerman/consul
自动构建
wdijkerman
Consul 1.8.2 running on Alpine 3.11
3 次收藏下载次数: 0状态:自动构建维护者:wdijkerman仓库类型:镜像最近更新:4 年前
轩辕镜像,让镜像更快,让人生更轻。点击查看
镜像简介版本下载
轩辕镜像,让镜像更快,让人生更轻。点击查看

wdijkerman/consul

  • wdijkerman/consul
  • Introduction
    • Volumes
    • User
    • Python?
  • Install the container
  • Using the container
    • Single node (Cluster) server
    • Multi node cluster
    • Agent
    • docker-compose
  • Configurations
    • Environment variables
    • Add commandline
    • Add configuration file
  • Ports
  • how to's
  • License
  • Issues

!Docker Stars !Docker Pulls ![Build Status]([***]

Introduction

This is an Docker container for Consul running on Alpine. The container is small, a little bit more than 75MB in size.

The versions in this Docker container:

  • alpine: 3.13
  • consul: 1.9.4
  • python: 3.8.5

Volumes

The consul application is installed in the /bin directory in the container, so is the start script. There data from Consul is in the /consul directory:

  • /consul/config
  • /consul/data

/consul/config The location of the config.json file. This is also an volume, so this can be mounted on the host.

/consul/data The location where Consul will store all data. This is also an volume, so this can be mounted on the host.

User

Consul is running as user consul. With the following capabilities (which are configured in this container)it should be no problem running Consul as non-root user:

  • cap_ipc_lock (Should not swap. Also --cap-add IPC_LOCK should be added to the command line when to start the Consul Server)
  • cap_net_bind_service (Can bind service <1023 as non root user)

The UID used in this container is 1050. So make sure the id is already available on the host running the container when host mounts are used.

Python?

Python is also installed in the container. Python is used for testing the container, which is done with the tool testinfra. You can see in the tests directory a file named test_consul.py which will be executed.

Install the container

Just run the following command to download the container:

bash
docker pull wdijkerman/consul

Using the container

There are several ways to use this container.

Single node (Cluster) server

This example will boot an single node Consul server, without any agents.

The following json file needs to be stored somewhere:

json
{
	"data_dir": "/consul/data",
	"log_level": "INFO",
	"client_addr": "0.0.0.0",
	"ports": {
		"dns": 53
	},
	"ui": true,
	"server": true,
    "bootstrap_expect": 1,
	"disable_update_check": true
}

Then you can use the following command to boot the Single node cluster:

bash
docker run  -p 8400:8400 -p 8500:8500 \
            -p 8600:53/udp -h server1 \
            -v path/to/file.json:/consul/config/my_config.json:ro \
            wdijkerman/consul

Multi node cluster

According to the official documentation of Consul bu Hashicorp, the best (or optimal) cluster size will be 3 or 5 nodes. The first node in the cluster is started differently than the others. The first node will be started like this:

bash
docker run  -p 8300-8302:8300-8302 \
            -p 8301-8302:8301-8302/udp \
            -p 8400:8400 -p 8500:8500 \
            -p 8600:53 -p 8600:53/udp \
            -v /data/consul/cluster:/consul/data \
            -v /data/consul/config:/consul/config \
            -h server1 wdijkerman/consul

As you see, we started the Consul cluster with the -bootstrap-expect 3 option. We let the Consul Cluster know that the size will be 3 server nodes. It doesn't matter how many agent nodes it use. We have an local directory '/data/consul/cluster' that will be mounted in the container, so no Consul data is lost when the container is restarted. (Make sure the UID of the directories are set to 995)

The rest of the nodes are started with the -join command. We do need the ip for the first Consul server first.

bash
docker run  -p 8300-8302:8300-8302 \
            -p 8301-8302:8301-8302/udp \
            -p 8400:8400 -p 8500:8500 \
            -p 8600:53 -p 8600:53/udp \
            -v /data/consul/cluster:/consul/data \
            -v /data/consul/config:/consul/config \
            -h server[2-5] wdijkerman/consul

The rest of the server will initially connect to the first booted server and will join the cluster.

Agent

When we have an Consul cluster, we can add agents to the cluster. They will handle the requests from other docker services

bash
docker run  -p 8301-8302:8301-8302 \
            -p 8301-8302:8301-8302/udp \
            -p 8400:8400 -p 8500:8500 \
            -p 8600:53 -p 8600:53/udp \
            -h agent[1-??] wdijkerman/consul

docker-compose

A docker-compose.yml file is present in the root, that can be used for starting a basic single node Consul Server.

bash
docker-compose -f docker-compose.yml up consul

Configurations

There are a lot of options to configure Consul. See this page for all options: [***]

Environment variables

You can use the following environment variables for configuring Consul:

  • CONSUL_INTERFACE_ADVERTISE: When a network interface is configured, it will use that ip of the interface as advertise address.
  • CONSUL_INTERFACE_BIND: When a network interface is configured, it will use that ip of the interface as bind address.
  • CONSUL_INTERFACE_CLIENT: When a network interface is configured, it will use that ip of the interface as client address.

Example:

bash
-e CONSUL_INTERFACE_BIND=eth0

Add commandline

You can add the options in the command line, see the following example:

bash
docker run  -p 8301-8302:8301-8302 \
            -p 8301-8302:8301-8302/udp \
            -p 8400:8400 -p 8500:8500 \
            -p 8600:53 -p 8600:53/udp \
            -h agent[1-??] wdijkerman/consul

In the configuration you see above, we have added the -advertise configuration option.

Add configuration file

You can also add a json configuration file. Place the json file in the /data/consul/config directory (Or use the directory which you use for storing configuration).

cat /data/consul/config/datacenter.json
{
  "datacenter": "nwg"
}

When Consul is restarted, you'll see that the datacenter is set to "nwg".

==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
           Version: 'v0.7.2'
         Node name: 'server1'
        Datacenter: 'nwg'
            Server: true (bootstrap: true)
       Client Addr: 0.0.0.0 (HTTP: 8500, HTTPS: -1, DNS: 53, RPC: 8400)
      Cluster Addr: 172.17.0.2 (LAN: 8301, WAN: 8302)
    Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false
             Atlas: <disabled>

Ports

Consul requires up to 5 different ports to work properly, some on TCP, UDP, or both protocols. Below we document the requirements for each port.

  • Server RPC (Default 8300). This is used by servers to handle incoming requests from other agents. TCP only.
  • Serf LAN (Default 8301). This is used to handle gossip in the LAN. Required by all agents. TCP and UDP.
  • Serf WAN (Default 8302). This is used by servers to gossip over the WAN to other servers. TCP and UDP.
  • CLI RPC (Default 8400). This is used by all agents to handle RPC from the CLI. TCP only.
  • HTTP API (Default 8500). This is used by clients to talk to the HTTP API. TCP only.
  • gRPC (Default 8502). This is used for to expose Envoy xDS API to Envoy proxies
  • DNS Interface (Default 8600). Used to resolve DNS queries. TCP and UDP.

how to's

Setting up a secure Consul cluster Configuring Access Control Lists

License

The MIT License (MIT)

See file: License

Issues

Please report issues at [***]

Pull Requests are welcome!

查看更多 consul 相关镜像 →
consul logo
consul
Docker 官方镜像
Consul是一种数据中心运行时工具,主要提供服务发现、配置管理和服务编排功能,能够助力分布式系统中的服务实现自动注册与发现、动态配置更新及服务生命周期协调管理,确保数据中心内各类服务高效、可靠地通信与协作,是构建现代化微服务架构和云原生应用的重要基础设施组件。
1.5千 次收藏10亿+ 次下载
1 年前更新
hashicorp/consul logo
hashicorp/consul
hashicorp
基于当前版本自动构建的Consul镜像。有关使用详情,请参见README。
91 次收藏5000万+ 次下载
14 天前更新
bitnami/consul logo
bitnami/consul
bitnami
Bitnami提供的Consul安全镜像,用于服务发现、配置管理及服务网格部署,具备安全加固特性。
10 次收藏1000万+ 次下载
7 个月前更新
bitnamicharts/consul logo
bitnamicharts/consul
bitnamicharts
Bitnami提供的HashiCorp Consul Helm chart,用于在Kubernetes集群上部署和管理Consul服务发现与配置工具,支持安全强化、Prometheus监控及自定义配置等功能。
50万+ 次下载
7 个月前更新
openeuler/consul logo
openeuler/consul
openeuler
暂无描述
355 次下载
1 个月前更新
unifio/consul logo
unifio/consul
unifio
HashiCorp Consul
1 次收藏1000万+ 次下载
9 年前更新

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

Docker 配置

登录仓库拉取

通过 Docker 登录认证访问私有仓库

专属域名拉取

无需登录使用专属域名

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

系统配置

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

MacOS OrbStack

MacOS OrbStack 容器配置

Docker Compose

Docker Compose 项目配置

NAS 设备

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

极空间

极空间 NAS 系统配置服务

网络设备

爱快路由

爱快 iKuai 路由系统配置

宝塔面板

在宝塔面板一键配置镜像

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

使用与功能问题

docker search 报错:专属域名下仅支持 Docker Hub 查询

docker search 报错问题

网页搜不到镜像:Docker Hub 有但轩辕镜像搜索无结果

镜像搜索不到

离线传输镜像:无法直连时用 docker save/load 迁移

离线传输镜像

Docker 插件安装错误:application/vnd.docker.plugin.v1+json

Docker 插件安装错误

WSL 下 Docker 拉取慢:网络与挂载目录影响及优化

WSL 拉取镜像慢

轩辕镜像是否安全?镜像完整性校验(digest)说明

镜像安全性

如何用轩辕镜像拉取镜像?登录方式与专属域名配置

如何拉取镜像

错误码与失败问题

manifest unknown 错误:镜像不存在或标签错误

manifest unknown 错误

TLS/SSL 证书验证失败:Docker pull 时 HTTPS 证书错误

TLS 证书验证失败

DNS 解析超时:无法解析镜像仓库地址或连接超时

DNS 解析超时

410 Gone 错误:Docker 版本过低导致协议不兼容

410 错误:版本过低

402 Payment Required 错误:流量耗尽错误提示

402 错误:流量耗尽

401 UNAUTHORIZED 错误:身份认证失败或登录信息错误

身份认证失败错误

429 Too Many Requests 错误:请求频率超出专业版限制

429 限流错误

Docker login 凭证保存错误:Cannot autolaunch D-Bus(不影响登录)

凭证保存错误

账号 / 计费 / 权限

免费版与专业版区别:功能、限额与使用场景对比

免费版与专业版区别

支持的镜像仓库:Docker Hub、GCR、GHCR、K8s 等列表

轩辕镜像支持的镜像仓库

拉取失败是否扣流量?计费规则说明

拉取失败流量计费

KYSEC 权限不够:麒麟 V10/统信 UOS 下脚本执行被拦截

KYSEC 权限错误

如何申请开具发票?(增值税普票/专票)

开具发票

如何修改网站与仓库登录密码?

修改网站和仓库密码

配置与原理类

registry-mirrors 未生效:仍访问官方仓库或报错的原因

registry-mirrors 未生效

如何去掉镜像名称中的轩辕域名前缀?(docker tag)

去掉域名前缀

如何拉取指定架构镜像?(ARM64/AMD64 等多架构)

拉取指定架构镜像

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
wdijkerman/consul
博客公告Docker 镜像公告与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
镜像拉取问题咨询请 提交工单,官方技术交流群:1072982923。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
镜像拉取问题咨询请提交工单,官方技术交流群:。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.