Docker how-to add extra port to current container

$ docker run -d -t -p 81:80 -v /home/imran/Projects/tmptmp:/var/www/html --name mycontainer ubuntu:latest /bin/bash
$ docker stop mycontainer
$ docker commit mycontainer mydockerimage
$ docker rm mycontainer
$ docker run -d -t -p 81:80 -p 444:443  -v /home/imran/Projects/tmptmp:/var/www/html --name mycontainer myusername/mydockerimage:latest /bin/bash

Leave a Reply