Is there a way to bind a docker container to localhost only?

Created:

2016-12-12 03:46:25 UTC

Modified:

2017-08-08 13:43:55 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Is there a way to bind a docker container to localhost only?

Applicable to:

  • Plesk Onyx for Linux

Question

Is there a way to bind a docker container to localhost only?

Answer

You may set container settings with docker command line tool. For example, if you want to create Mysql container with specific port 3310 on localhost, you may use command like that:

# docker run --name=mymysql -e MYSQL_ROOT_PASSWORD=123qwe -p 127.0.0.1:3310:3306 mysql
Have more questions? Submit a request
Please sign in to leave a comment.