docker container run busybox
docker container ls
docker container ls -a
docker container run --rm busybox
docker container ls -a
docker container run nginx
docker container run -d nginx
docker container ls
docker container ls -a
docker container run -it busybox
# ls
# exit
docker container prune -f
docker container run --name my_busybox busybox
docker container ls -a
===Summary===
docker container run:--helpPrint usage--rmAutomatically remove the container when it exits-d,--detachRun container in background and print container ID-i,--interactiveKeep STDIN open even if not attached--name stringAssign a name to the container-p,--publish listPublish a container's port(s) to the host-t,--ttyAllocate a pseudo-TTY-v,--volume listMount a volume (the bind type of mount)--mount mountAttach a filesystem mount to the container--network stringConnect a container to a network (default "default")
Create a container and attach to it:
docker container run –it busybox
Create a container and run it in the background:
docker container run –d nginx
Create a container that you name and run it in the background:
docker container run –d –name myContainer busybox