如何将docker默认IP地址映射到域名

时间:2022-01-15 02:57:11

I have setup my Drupal using the Docker and accessing my sites through ip . But now i want to map docker IP address to some domain name in my local machine . can anyone please help me. something like this: Ex : http://192.160.168.3 to http://mysites

我使用Docker设置我的Drupal并通过ip访问我的网站。但现在我想将docker IP地址映射到本地计算机中的某个域名。谁能帮帮我吗。像这样的东西:例如:http://192.160.168.3到http:// mysites

1 个解决方案

#1


0  

Create the local host name as

创建本地主机名为

sudo echo "127.0.0.1 mysite.local" >> /etc/hosts

Now you can redirect to your application with mysite.local

现在,您可以使用mysite.local重定向到您的应用程序

#1


0  

Create the local host name as

创建本地主机名为

sudo echo "127.0.0.1 mysite.local" >> /etc/hosts

Now you can redirect to your application with mysite.local

现在,您可以使用mysite.local重定向到您的应用程序