docker build -t foo . && docker run -it foo
-- Windows // Make run.bat add
docker build -t foo . docker run -it foo
- To run the file using powershell or cmd do this:
./run.bat
docker-compose up
sudo docker container ls sudo docker container ps sudo docker container list sudo docker ps sudo docker ps -a
Options -:
-a, --all Show all containers (default shows just running) -f, --filter filter Filter output based on conditions provided --format string Pretty-print containers using a Go template -n, --last int Show last created containers (includes all states) (default -1) -l, --latest Show the latest created container (includes all states) --no-trunc Don't truncate output -q, --quiet Only display numeric IDs -s, --size Display total file sizes
Options | Comment |
---|---|
-a, --all | Show all containers (default shows just running |
-f, --filter filter | Filter output based on conditions provided |
--format string | Pretty-print containers using a Go template |
-n, --last int | Show last created containers (includes all states) (default -1) |
-l, --latest | Show the latest created container (includes all states) |
--no-trunc | Don't truncate output |
-q, --quiet | Only display numeric IDs |
-s, --size | Display total file sizes |
sudo docker ps //Showing only running containers
sudo docker ps -a //All container (running + stopped)
sudo docker pa -l // latest
sudo docker ps -n <int valuse 1,2,3 etc>// latest number of created containers
sudo docker ps -s // Display container with size
sudo docker ps -q // Only display numeric IDs for containers
docker docker ps -a | tail -n 1 //oldest container
ping another container docker exec -ti [ping from container name] ping [target container name]
docker inspect [docker-image-name]