For example, if I have a Jenkins server in my intranet, I have to remember its IP and port number if I want to access it. I can remember one service, but if I have more than one, I may need a domain name that is easy to remember to record some intranet services. Step 1: Prepare the Docker environment Step 2: Download the image
Step 3: Run dnsmasq #Background start docker run -d -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN --name dns-server andyshinn/dnsmasq:2.75 #Enter the container docker exec -it dns-server /bin/sh #Create proxy file-add external dns vi /etc/resolv.dnsmasq nameserver 114.114.114.114 nameserver 8.8.8.8 #Create a new local resolution rule configuration-add local resolution rule#Note: The ip here should be filled in with the ip of the host where docker is located vi /etc/dnsmasqhosts .168.3.54 jenkins.ean.com test1.ean.com .168.3.54 redis.ean.com #Append the two files we just configured #vi /etc/dnsmasq.conf resolv-file=/etc/resolv.dnsmasq addn-hosts=/etc/dnsmasqhosts #Exit the container & restart exit docker restart dns-server Step 4: Set up nginx Be sure to install nginx as a domain name reverse proxy on 3.54 server{ listen 80; server_name jenkins.ean.com; proxy_set_header Host $host; location /{ proxy_pass http://192.168.3.54:8060; } } Additional knowledge: docker pull private warehouse image 1. Docker pull private warehouse error
Due to different Docker versions, you can try the following two methods: (configuration on the client) (1) Method 1: By configuring /etc/docekr/daemon.json vim /etc/docker/daemon.json { "insecure-registry": ["172.16.12.196:5000"] (warehouse address) } (2) Method 2: By configuring /etc/sysconfig/docker
The above article about setting up DNS in Docker intranet and using domain name access instead of ip:port is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: JS implementation of carousel carousel case
Generally, lists have selection functions, and si...
Table of contents Manual deployment 1. Create a s...
This article shares with you the specific method ...
Preface About the performance comparison between ...
Xhtml has many tags that are not commonly used but...
Table of contents nextTick v-model syntax sugar ....
Table of contents Step 1: Install node_modules in...
1. First, create a hello-world.cpp file The progr...
HTML form tag tutorial, this section mainly expla...
This question is a discussion among netizens in a...
(1) Each HTML tag has an attribute style, which c...
Preface Engineers working in the Linux environmen...
1. Create a new configuration file docker_nginx.c...
I have always used Loadrunner to do performance t...
When a thread executes a DELAYED statement for a ...