用shell写一份可以在centos7下用docker部署nginx
时间: 2024-04-30 21:17:30 浏览: 160
Sure, I can help you with that! Here's a sample shell script for deploying Nginx using Docker on CentOS 7:
```
#!/bin/bash
# Install Docker
sudo yum install -y docker
# Start Docker service
sudo systemctl start docker
# Pull Nginx Docker image
sudo docker pull nginx
# Create Docker container for Nginx
sudo docker run -d --name my-nginx -p 80:80 nginx
echo "Nginx deployed successfully!"
```
You can save this script as a .sh file and run it on your CentOS 7 server to deploy Nginx using Docker. Let me know if you have any other questions!
阅读全文