vm.node ➜ ~ nerdctl run -d --name test -p 8080:80 nginx:alpine 80342ff329574ab290c212b2b786b52dd0c3f3209ee8e9e06878259dd1186879 vm.node ➜ ~ nerdctl ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 80342ff32957 docker.io/library/nginx:alpine "/docker-entrypoint.…" 3 seconds ago Up 0.0.0.0:8080->80/tcp test vm.node ➜ ~ curl 10.0.0.5:8080 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> 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>
唯一需要注意的是部分命令选项还是有一定不兼容,比如 run 的时候 -d 和 -t 不能一起用,--restart 策略不支持等,但是通过列表可以看到大部分 cli 都已经完成了。