1. Create a new configuration file docker_nginx.conf on this machine server { listen 7070; server_name localhost; charset utf-8; location /files { #In docker, nginx's directory alias /home/files; expires 1d; allow all; autoindex on; } 2. Start the command docker run --name nginx -d -p 7070:7070 -v D:\dev\nginx-1.13.6\conf\docker_nginx.conf:/etc/nginx/nginx.conf -v D:\tools\files:/home/files nginx illustrate:
3. Results Visit localhost:7070/files to see the final mapped files. Execute the command docker exec -it nginx bash to enter docker nginx. The result is as follows λ docker exec -it nginx bash root@178a892f73ce:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var root@178a892f73ce:/# cd home/ root@178a892f73ce:/home# ls files root@178a892f73ce:/home# cd files/ root@178a892f73ce:/home/files# ls 2018-08-09 2018-08-13 2018-09-04 root@178a892f73ce:/home/files# exit exit The above is the detailed content of the method and steps for building an nginx file server based on docker. For more information about building an nginx file server with docker, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: JavaScript canvas to achieve mirror image effect
>>: Several ways to backup MySql database
1. Add a hard disk 2. Check the partition status:...
To query two different tables, you need to merge ...
Table of contents 1. Use object to create an obje...
Flex Layout Flex is the abbreviation of Flexible ...
Elastic stack, commonly known as ELK stack, is a ...
Create a new project test1 on Code Cloud Enter th...
Time flies, and in just six days, 2013 will becom...
count(*) accomplish 1. MyISAM: Stores the total n...
1. Modify the firewall settings and open the corr...
Linux remote deployment of MySQL database, for yo...
The concept of relative path Use the current file...
Table of contents 1. switch 2. While Loop 3. Do/W...
Test environment: C:\>systeminfo | findstr /c:...
When we use the folder properties dialog box in Wi...
Preface Zabbix is one of the most mainstream op...