Articles in this section

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

kb: how-to ABT: Group B

Applicable to:

  • Plesk Obsidian for Linux

Question

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

Answer

It may be set by the container settings, with docker command line tool.

For example, to create a Mysql container with specific port 3310 on localhost, a command line like this one should be used:

# docker run --name=mymysql -e MYSQL_ROOT_PASSWORD=password -p 127.0.0.1:3310:3306 mysql

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.