· Dec 1, 2019

Add ports to Google Cloud docker container?

I want to add ports 9100 and 9101 in addition to 52773. I read on docker container documentation that this is not possible on a already ran image. Currently it starts the google cloud IRIS health container automatically without me able to specify the additional ports. How can I add ports to Google cloud IRIS Health container?

Discussion (5)0
Log in or sign up to continue

Yeah, I forgot about docker. But it is possible to solve this as well. 

Connect to the instance with SSH in any way offered by Google.

cd /opt/ISC
sudo vi docker-compose.yml

So, you can now add more ports. Save it (:wq)))

sudo docker-compose up -d

Do not forget to configure firewall rules.

You can even add this line, and remove ports block at all, and get access to any future ports without a restart container.

network_mode: host

And so it is:

@intersystems-iris-community-edition-1-vm:~$ cd /opt/ISC
@intersystems-iris-community-edition-1-vm:/opt/ISC$ sudo vim docker-compose.yml
@intersystems-iris-community-edition-1-vm:/opt/ISC$ sudo docker-compose up -d
Recreating try-iris ... done
@intersystems-iris-community-edition-1-vm:/opt/ISC$ sudo docker ps -a
CONTAINER ID        IMAGE                                            COMMAND             CREATED              STATUS                                 PORTS                      
db93ab338e46        intersystems/iris-community:2019.4.0.379.0-gcp   "/iris-main"        About a minute ago   Up About a minute (health: starting)>9100-910
1/tcp,>51773/tcp,>52773/tcp   try-iris