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
This old question has troubled countless front-end...
My mysql version is MYSQL V5.7.9, please use the ...
Basics A transaction is an atomic operation on a ...
Recently, I found that the company's server t...
Hash Join Hash Join does not require any indexes ...
MySQL database is widely used, especially for JAV...
In this project, the Docker container is used to ...
The current environment is: Centos 7.5 docker-ce ...
This article summarizes various ways to implement...
Preface lvm (Logical Volume Manager) logical volu...
This article uses an example to illustrate how to...
Preface DISTINCT is actually very similar to the ...
1. Prepare the Java environment, jdk1.8 Check whe...
In the field of design, there are different desig...
1. Introduction First of all, we need to answer a...