Creating a Container with Tunnel Origins
Tunnel origins must be mapped at container runtime. This article covers creating a new container with port mappings for an origin. To modify port mappings for an existing container, see Updating Port Mappings for Containers.
Docker requires that all container ports are mapped at startup. To add an origin to a new container:
Obtain a One-Time Passkey from an existing member of the cluster or gateway group by executing
Create a new container from one of the DH2i images (
dh2i/dxemssql) by executing the
docker runcommand. The
-pflags specify each mapped port,
-druns the container detached,
-vcreates a new volume mount for
-hspecifies the hostname used by the container, and
--namespecifies the name the Docker host will use for the container. For example:
docker run -p 7979:7979 -p <ORIGIN_PORT_MAPPING> -d -v dxovol:/etc/dh2i -h <CONTAINER_HOSTNAME> --name <CONTAINER_NAME> <IMAGE_NAME>
Join the node or gateway to the cluster or gateway group by executing
docker exec <CONTAINER_NAME> dxcli join-cluster-exor
docker exec <CONTAINER_NAME> dxcli join-gateway-group-ex. More information on these commands can be found in the DxCLI guide for DxEnterprise or DxOdyssey.
Add the new node or gateway as an origin to the tunnel by executing
docker exec <CONTAINER_NAME> dxcli add-tunnelwith parameters that utilize the Docker port mapping. More information on this command can be found in the DxCLI guide for DxEnterprise or DxOdyssey.