{"id":16940634,"url":"https://github.com/greenpau/docker-consul","last_synced_at":"2026-04-29T20:34:29.089Z","repository":{"id":83535366,"uuid":"105610665","full_name":"greenpau/docker-consul","owner":"greenpau","description":"Consul Server in Docker","archived":false,"fork":false,"pushed_at":"2017-10-03T03:30:20.000Z","size":10073,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T00:37:54.781Z","etag":null,"topics":["consul","docker-compose","docker-image"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greenpau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-03T03:26:02.000Z","updated_at":"2017-10-03T03:30:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c77740c-8614-4bed-aee3-f000878ba07c","html_url":"https://github.com/greenpau/docker-consul","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"15d21994f0f8171aea8fd4a08a35b2b83df20ec0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/greenpau/docker-consul","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fdocker-consul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fdocker-consul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fdocker-consul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fdocker-consul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenpau","download_url":"https://codeload.github.com/greenpau/docker-consul/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fdocker-consul/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consul","docker-compose","docker-image"],"created_at":"2024-10-13T21:07:33.256Z","updated_at":"2026-04-29T20:34:29.067Z","avatar_url":"https://github.com/greenpau.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Consul Services\n\nThis repository contains Docker files for `consul` service.\nThe KV (key-value) store functionality of Consul is necessary for\nthe Docker remote LibNetwork drivers to work.\n\n## Getting Started\n\nFirst, validate `consul` configuration file:\n\n```\nconsul validate consul/config\n```\n\nNext, start the service with `systemd`.\n\nOnce the service is working, check existing members:\n\n```\ndocker exec -it consul /bin/consul members\n```\n\nThe expected result is:\n\n```\nNode          Address          Status  Type    Build  Protocol  DC   Segment\n9a9226b51cec  172.21.0.2:8301  alive   server  0.9.3  2         net  \u003call\u003e\n```\n\nAlternatively, a user may get detailed view:\n\n```\ndocker exec -it consul /bin/consul members -detailed\ndocker exec -it consul /bin/consul operator raft -list-peers\n```\n\nThe expected result is:\n\n```\n9a9226b51cec  172.21.0.2:8301  alive   bootstrap=1,build=0.9.3:112c060,dc=net,id=b182a4c7-a17e-c943-541e-ecff8798f940,port=8300,raft_vsn=2,role=consul,segment=\u003call\u003e,vsn=2,vsn_max=3,vsn_min=2,wan_join_port=8302\n```\n\nA user may perform the following queries:\n\n```\ndocker exec -it consul /bin/consul kv get -keys\ndocker exec -it consul /bin/consul kv get -recurse docker/\ndocker exec -it consul /bin/consul kv get -recurse docker/network/v1.0/network/\ndocker exec -it consul /bin/consul kv get -recurse docker/network/v1.0/endpoint_count/\n```\n\nA user may query a Consul server remotely:\n\n```\nconsul kv get -http-addr=10.1.1.1:8500 -recurse docker/\n```\n\nA user may browse to Consul UI: `http://10.1.1.1:8500/ui/`\n\nIf necessary review Consul logs:\n\n```\ndocker logs consul\njournalctl -u consul -r\n```\n\n## Systemd Service\n\nThe following commands help to set up DNS as a service in `systemd`:\n\n```\ncd /usr/local/share\ncp consul/systemd/consul.service /etc/systemd/system/consul.service\nsystemctl enable consul\nsystemctl daemon-reload\nsystemctl start consul\nsystemctl status consul\n```\n\nIf the build did not work, use the following commands for cleanup:\n\n```\nsystemctl stop consul\ndocker rm consul\ndocker rmi greenpau/consul\ndocker network prune -f\n```\n\nIf necessary, transfer files to the remote host:\n\n```\nscp -i ~/.ssh/id_rsa -r ../consul root@remotehost:/usr/local/share/consul\n```\n\n## Firewall\n\nTypically, `/etc/sysconfig/iptables` configuration file holds firewall\nconfiguration on RHEL/CentOS.\n\nFirst, backup existing firewall configuration:\n\n```\niptables-save \u003e ~/`hostname -s`.`date +%Y%m%d.%H%M%S`.iptables.conf\n```\n\nAdd the following lines to the file:\n\n```\n-A INPUT -p udp --dport 8600 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 8300 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 8500 -j ACCEPT\n```\n\nReference: [Consul Used Ports](https://www.consul.io/docs/agent/options.html#ports-used)\n\nVerify existing rules:\n\n```\niptables -L -n --line-numbers\n```\n\nIf necessary, insert entries to `iptables` runtime:\n\n```\niptables -I INPUT 13 -p udp --dport 8600 -j ACCEPT\niptables -I INPUT 13 -p tcp -m state --state NEW -m tcp --dport 8300 -j ACCEPT\niptables -I INPUT 13 -p tcp -m state --state NEW -m tcp --dport 8500 -j ACCEPT\n```\n\nPlease note, the `13` is the rule number with `REJECT`.\n\n## Docker and Libnetwork\n\nExecute the following command to make Docker utilize Consul K/V store:\n\n```\ncat \u003c\u003c EOF \u003e /etc/sysconfig/docker-keystore\nDOCKER_KEYSTORE_OPTIONS = --cluster-store=\"consul://consul:8500\"\nEOF\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenpau%2Fdocker-consul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenpau%2Fdocker-consul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenpau%2Fdocker-consul/lists"}