1、安装docker和docker-compose
步骤略
2、任意目录创建docker-compose.yml文件
touch docker-compose.yml
touch nginx.conf
3、修改docker-compose.yml 文件
version: '3'
services:
nginx:
image: nginx
container_name: tcpnginx
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
4、在同目录创建nginx.conf
events {}
stream {
server {
listen 41860;
proxy_pass 172.16.22.203:9000;
}
}
运行docker-compose up -d
标签:compose,TCP,nginx,conf,touch,docker,yml From: https://www.cnblogs.com/jackson1024/p/17927356.html