Docker Support¶
A pre-built Docker image can be used as an alternative to installing a Python environment with the libraries required for the DomainTools API DXL service. Docker images for the DomainTools API DXL service are posted to the following Docker repository:
https://hub.docker.com/r/opendxl/opendxl-domaintools-service-python/
The remainder of this page walks through the steps required to configure the service, pull the image from the repository, and run the DomainTools API DXL service via a Docker container.
Service Configuration¶
The first step is to connect to the host that is running Docker and configure the DomainTools API DXL service. The configuration files that are required for the DomainTools API DXL service will reside on the host system and be made available to the Docker container via a data volume.
Once you have logged into the host system, perform the following steps:
1.) Create a directory to contain the configuration files
mkdir dxldomaintoolsservice-config2.) Change to the newly created directory
cd dxldomaintoolsservice-config3.) Download the latest configuration files for the DomainTools API DXL service
The latest release of the service can be found at the following page:
https://github.com/opendxl/opendxl-domaintools-service-python/releases/latest
Download the latest configuration package (dxldomaintoolsservice-python-dist-config). For example:
wget https://github.com/opendxl/opendxl-domaintools-service-python/releases/download/0.2.1/dxldomaintoolsservice-python-dist-config-0.2.1.zip4.) Extract the configuration package
unzip dxldomaintoolsservice-python-dist-config-0.2.1.zip5.) Populate the configuration files:
Pull Docker Image¶
The next step is to pull the DomainTools API DXL service image from the Docker repository.
The image can be pulled using the following Docker command:
docker pull opendxl/opendxl-domaintools-service-python:<release-version>
The following parameters must be specified:
release-version
The release version of the DomainTools API DXL service
For example:
docker pull opendxl/opendxl-domaintools-service-python:0.2.1
Create Docker Container¶
The final step is to create a Docker container based on the pulled image.
The container can be created using the following Docker command:
docker run -d --name dxldomaintoolsservice -v <host-config-dir>:/opt/dxldomaintoolsservice-config opendxl/opendxl-domaintools-service-python:<release-version>
The following parameters must be specified:
host-config-dir
The directory on the host that contains the service configuration filesrelease-version
The version of the image (See "Pull Docker Image" section above)
For example:
docker run -d --name dxldomaintoolsservice -v /home/myuser/dxldomaintoolsservice-config:/opt/dxldomaintoolsservice-config opendxl/opendxl-domaintools-service-python:0.2.1
Note: A restart policy can be specified via the restart flag (--restart <policy>
). This flag can be used to restart
the container when the system reboots or if the service terminates abnormally. The unless-stopped
policy will
restart the container unless it has been explicitly stopped.
Additional Docker Commands¶
The following Docker commands are useful once the container has been created.
Container Status
The
ps
command can be used to show the status of the container.
docker ps --filter name=dxldomaintoolsservice
Example output:
CONTAINER ID COMMAND CREATED STATUS c60eaf0788fe "python -m dxldomaintoo" 7 minutes ago Up 7 minutesContainer Logs
The
logs
command can be used to display the log messages for the container.
docker logs dxldomaintoolsservice
Example output:
Running application ... On 'run' callback. On 'load configuration' callback. Incoming message configuration: queueSize=1000, threadCount=10 Message callback configuration: queueSize=1000, threadCount=10 Attempting to connect to DXL fabric ... Connected to DXL fabric. Registering service: domaintools_service Registering request callback: domaintools_account_information_requesthandler Registering request callback: domaintools_brand_monitor_requesthandler Registering request callback: domaintools_domain_profile_requesthandler Registering request callback: domaintools_domain_search_requesthandler Registering request callback: domaintools_domain_suggestions_requesthandler Registering request callback: domaintools_hosting_history_requesthandler Registering request callback: domaintools_ip_monitor_requesthandler Registering request callback: domaintools_ip_registrant_monitor_requesthandler Registering request callback: domaintools_name_server_monitor_requesthandler Registering request callback: domaintools_parsed_whois_requesthandler Registering request callback: domaintools_registrant_monitor_requesthandler Registering request callback: domaintools_reputation_requesthandler Registering request callback: domaintools_reverse_ip_requesthandler Registering request callback: domaintools_host_domains_requesthandler Registering request callback: domaintools_reverse_ip_whois_requesthandler Registering request callback: domaintools_reverse_name_server_requesthandler Registering request callback: domaintools_reverse_whois_requesthandler Registering request callback: domaintools_whois_requesthandler Registering request callback: domaintools_whois_history_requesthandler Registering request callback: domaintools_phisheye_requesthandler Registering request callback: domaintools_phisheye_term_list_requesthandler Registering request callback: domaintools_iris_requesthandler On 'DXL connect' callback.The log output can be followed by adding a
-f
flag (similar to tail) to the logs command.Stop/Restart/Start
The container can be stopped, restarted, and started using the following commands:
docker stop dxldomaintoolsservice
docker restart dxldomaintoolsservice
docker start dxldomaintoolsservice