You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run ubuntu # download the image and run it
docker pull ubuntu # download the image only# ----------------------------------------------------
docker ps # list all running containers only
docker ps -a # list all containers# ----------------------------------------------------
docker stop <container ID | name># stops docker container
docker kill<container ID | name># ----------------------------------------------------
docker rm <container ID | name># remove container from disk
docker images # list of images
docker image ls # list of images
docker rmi <imageID># remove image if no dependent containers## appending commands
docker run ubuntu sleep 100 # sleep for 100 seconds
docker exec<container ID | name> cat /etc/hosts
$ find /etc -iname "*release*"# i: interactive, t: terminal
docker run -ti ubuntu /bin/bash
# for ubuntu only, by default include CMD["/bin/bash"]
docker run -ti ubuntu
attach or detach
docker run -d ubuntu sleep 500 # sleep for 5s in detach mode
docker attach <container ID># attaching back to terminal
docker run -p 49160:8080 -d eisson/node-app
# then go http://localhost:49160 in your host.# the container will keep that configuration until you do# docker rm <containerID>
----------------------------------------------------------
docker exec -it <container id> /bin/bash
eisson@eisson:~$ docker run -p 80:8080 -d eisson/node-app
92612fd1086dd197e8c480358e88a56f78b38d86a91
eisson@eisson:~$ docker exec -it 92612 /bin/bash
root@92612fd1086d:/usr/src/simple-node-app#
logs
docker logs <containerID>
remove container after run
docker run --rm ubuntu cat /etc/hosts
stats and process
docker stats [container id or name]
docker top [container id or name]
docker volumes mapping
docker run -v /opt/datadir:/var/lib/mysql mysql
:::::: docker compose :::::
docker-compose up
docker-compose down
kubernetes:
kubectl run hello-minukube
kubectl cluster-info
kubectl get nodes
kubectl get services