Run an docker image and expose a port

use the -p option:

docker run -p <host_port1>:<container_port1> -p <host_port2>:<container_port2>

Example:

docker run -p 8022:22 -i -t ltse-sandbox /bin/bash

Maps port 22 to host port 8022.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s