Home  >  Article  >  Operation and Maintenance  >  How to use docker to modify Nginx files

How to use docker to modify Nginx files

王林
王林forward
2023-05-19 15:52:061705browse

1. Install nginx with docker:

It is very simple to install nginx with docker. You can refer to this official website article

2. After installation, enter the docker container:

Execute command: docker exec -it container id bash. Note that the container must be open to enter.

How to use docker to modify Nginx files

3. Take modifying nginx’s index.html as an example:

1. Enter the directory where index is located: cd usr/share/nginx /html

2. Edit index.html. Here comes the key point. An error will be reported, as follows

How to use docker to modify Nginx files

3. It prompts that there is no vim command. Install this command: apt-get install vim

If unsuccessful

How to use docker to modify Nginx files

Update apt-get command: apt-get update

4. Update completed Then execute the third step command: apt-get install vim

5.vim After the command is successfully imported, enter /usr/share/nginx/html and execute: vim index.html

How to use docker to modify Nginx files

3. External request verification:

How to use docker to modify Nginx files

The above is the detailed content of How to use docker to modify Nginx files. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete