Guide · 6 mins
How do I run a container?
corail run starts one container and exits.
$ corail run -d \ --name web \ -p 8080:80 \ nginx:1.27
-dleaves the container running. The command returns.--name webis the id forps,logs,stop, andrm.-p 8080:80publishes port 80 in the container on port 8080 of the host.-pneeds root, with--net bridge.nginx:1.27is the image. corail pulls it when it is not cached.
Rootless, drop -p. The default network is the host's, so a port the process binds is a port on the host.
$ corail run -d --name web nginx:1.27
$ corail ps $ corail logs web $ corail stop web $ corail rm web
stop sends the stop signal. The container stays in ps as exited until rm. A recorded session is on Run a container. Every flag is on Commands.