DCDC: Docker Container Domain Connector
DCDC provides a local DNS server for exposing docker containers on bridge networks.
This allows you to easily reference containers by name instead of exposing and binding IP addresses / ports on the localhost. Names are in the form of container-name.compose-project-name.dcdc
% dig mysql.my-project.dcdc
; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> mysql.my-project.dcdc
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59483
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;mysql.my-project.dcdc. IN A
;; ANSWER SECTION:
mysql.my-project.dcdc. 51 IN A 192.168.144.3
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Fri May 10 20:56:11 AEST 2024
;; MSG SIZE rcvd: 71
Setup
Install DCDC
# TODO: upload to pypi
pip install docker-container-domain-conenctor
Configure systemd-resolved
Edit /etc/systemd/resolved.conf
[Resolve]
DNS=127.0.0.1:9953#dcdc
Run DCDC
dcdc
Restart systemd-resolved
sudo systemctl restart systemd-resolved
Test
dig some.container.dcdc
Usage
The main application is provided by the dcdc command.
usage: dcdc [-h] [-v] [--log-dir PATH] [--version] [--host HOST] [--port PORT] [--tcp | --udp]
[--root-domain ROOT_DOMAIN]
dcdc (Docker Container Domain Connector) is a dns server that allows mapping docker containers to their currently running bridge ip address.
options:
-h, --help show this help message and exit
-v, --verbose Increase logging verbosity
--log-dir PATH Set where log files should be stored. Defaults to /var/tmp
--version show program's version number and exit
--host HOST Host (IP) to bind to. Use --ips to see available. Defaults to localhost.
--port PORT Port to bind to. Defaults to 9953.
--tcp Use TCPv4 socket for transport.
--udp Use UDPv4 socket for transport. (default)
--root-domain ROOT_DOMAIN
Root domain for queries (e.g. <query>.<root>). Does not have to be a TLD, can
be any level of domain. Defaults to ".dcdc".
This package also provies the dcdc-ips utility command which will print available IP addresses.
Licence
This project is licenced under the MIT Licence - see LICENCE.
Authors
A project by Nicholas Hairs - www.nicholashairs.com.
Metadata
Release files for docker-container-domain-connector 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docker_container_domain_connector-0.1.1.tar.gz | 16.8 kB | Without provenance | Details for docker_container_domain_connector-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docker_container_domain_connector-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for docker_container_domain_connector-0.1.1-py3-none-any.whl |
Total release size: 24.4 kB
Release files / docker_container_domain_connector-0.1.1.tar.gz
| Download URL | docker_container_domain_connector-0.1.1.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41279dda82570b418cbd323a222e1012102bc88d9f8f927e9e6954ce054f73de
|
|
BLAKE2b-256 checksum How to use checksums |
1d27cbde7c4eadbbfbcd9c088a294b760272788f7ec132822335eed07c73c817
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / docker_container_domain_connector-0.1.1-py3-none-any.whl
| Download URL | docker_container_domain_connector-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10c30e1882898f169251f0cd8388d058f57b59f4e8143ccad024762340a680ce
|
|
BLAKE2b-256 checksum How to use checksums |
31e4ece8d5f52d9a55c06a7e81a4cd70c6d39c4456fc277fb36295abf49d2dc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for docker-container-domain-connector 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.