Adding a Tunnel Origin to a Docker Container
- DxOdyssey 19.5 and newer
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 this KB article.
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 gateway group by executing “dxcli set-otpk”.
- Create a new container from the DH2i base image by executing the “docker run” command. 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 name the Docker host will use for the container. For example:
docker run -p 7979:7979 -p < ORIGIN_PORT_MAPPING > -d -v dxoVolume:/etc/dh2i -h < CONTAINER_HOSTNAME > --name < CONTAINER_NAME > dh2i/dxo
- Start a new shell in the container by executing “docker exec -it < CONTAINER_NAME > bash”
- Join the gateway to the gateway group by executing “dxcli join-gateway-group”, follow the prompts and supply the one-time passkey created in the previous step.
- Add the new gateway as an origin to the tunnel by executing “dxcli add-tunnel” with parameters that utilize the Docker port mapping.
- DxOdyssey v19.5 DxCli Guide
- Using DxConnect with Linux DxOdyssey Installations
- Creating a Docker Container for DxOdyssey
- Updating Port Mappings for DxOdyssey Docker Containers
- Updating Port Mappings for DxOdyssey Docker Containers Using “docker commit”
- How to Setup a Docker Container as a Tunnel Origin without using DxConnect
- Command Line Deployments of DxOdyssey