#搜索nginx
docker search nginx
#下载nginx
docker pull nginx
#启动nginx
docker run -d --name nginx01 -p 3344:80 nginx
//解释
-d 后台运行
--name 别名,便于区分
nginx01 别名
-p 端口号
3344:80 3344是linux主机的端口,80是容器内部的端口
root@1014f183fca6:/# curl localhost:80
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>