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
As more and more Docker images are used, there ne...
After the official release of Activiti7, it has f...
Apache Log4j2 reported a nuclear-level vulnerabil...
This article shares the specific code for the js ...
The javascript function for converting <table&g...
A reader contacted me and asked why there were pr...
The development of Docker technology provides a m...
There are also two servers: Preparation: Set the ...
This article shares the specific code for impleme...
I recently encountered a problem at work. The doc...
export default ({ url, method = 'GET', da...
WebService Remote Debugging In .NET, the remote d...
Table of contents 1.Vue.js features: 2.Observer.j...
I recently started learning Linux. After reading ...
In requireJS, there is a property called baseURL....