Setting port mapping in docker on Container-Optimized OS

262 views Asked by At

I am trying to setup couchdb on Container-Optimized OS inside Google CLoud Platform. The container needs 5984 port to be redirected to host. I can't make it work with standard container setup, I can't see a place to define custom parameters to 'docker run'.

When I SSH to host and run another docker with port mapping, it works (with some firewall settings to allow connection from outside to this port).

I spend two evening reading through documentation, I found metadata settings for instance, but this is the yaml file with kubernetees object (as far as I understand) and it contains only options that can be set from UI.

yaml file:

spec:
  containers:
    - name: couch-1
      image: 'couchdb:3'
      securityContext:
        privileged: true
      stdin: false
      tty: false
  restartPolicy: Always

There is also a way to provide custom startup script in which I could run another docker, I didn't try that but I am not sure if this is right solution.

0

There are 0 answers