Skip to main content
Version: v26.0

Creating a Container with Tunnel Origins

Summary​

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.

Information​

Container runtimes require that all container ports are mapped at startup. To add a tunnel origin to a new container:

  1. Obtain a One-Time Passkey from an existing member of the cluster or gateway group by executing dxcli set-otpk.

  2. Create a new container from one of the DH2i images (dh2i/dxe, dh2i/dxo, or dh2i/dxemssql) using your container runtime.

The -p flags specify each mapped port, -d runs the container detached, -v creates a new volume mount for /etc/dh2i, -h specifies the hostname used by the container, and --name specifies the container name.

docker run \
-p 7979:7979 \
-p <ORIGIN_PORT_MAPPING> \
-d \
-v dxovol:/etc/dh2i \
-h <CONTAINER_HOSTNAME> \
--name <CONTAINER_NAME> \
<IMAGE_NAME>
  1. Join the node or gateway to the cluster or gateway group using the appropriate DxCLI command.

For DxEnterprise, run:

docker exec <CONTAINER_NAME> dxcli join-cluster-ex

For DxOdyssey, run:

docker exec <CONTAINER_NAME> dxcli join-gateway-group-ex

More information on these commands can be found in the DxCLI guides for DxEnterprise and DxOdyssey.

  1. Add the new node or gateway as a tunnel origin using the mapped container ports.
docker exec <CONTAINER_NAME> dxcli add-tunnel <parameters>

More information on these commands can be found in the DxCLI guides for DxEnterprise and DxOdyssey.

Additional information​