April 10, 2021
go to https://docs.docker.com/get-started/
download version for your OS
docker versionThis is will create a new contrainer and return its id
docker create hello-worlddocker start -a ecfa027a48b2840d6ec8db4d14e558577bf3f6c06d5539090bdada3fd5ca8e29Will print all of the logs when it is running
docker start -a ecfa027a48b2840d6ec8db4d14e558577bf3f6c06d5539090bdada3fd5ca8e29Will only print the response
Run = Create + Start
docker run busybox echo hi thereSends SIGTERM and waits till process stop before it stops container
docker create busybox ping google.com
docker start a2b4916bd95adfd7badc8db02f40cb1ab816e66be970a306771f5dee4c189af5
docker ps
docker stop a2b4916bd95aSends SIGKILL will shut down now and does not wait for processes to stop
docker create busybox ping google.com
docker start a2b4916bd95adfd7badc8db02f40cb1ab816e66be970a306771f5dee4c189af5
docker ps
docker kill a2b4916bd95aThis will delete stopped containers, cache, and images
docker system prunedocker psYou are able to reuse container id to run it
docker ps --alldocker create busybox echo hi there
docker start 12122afb3886801718694ed0d32fc414cbcf051f330515f5c5690f5c6b00924
docker logs 12122afb3886801718694ed0d32fc414cbcf051f330515f5c5690f5c6b00924docker run redis
docker ps
docker exec -it f82394b79b0d redis-clidocker run redis
docker ps
docker exec -it f82394b79b0d sh
redis-sever