Docker
- Kiazsoft
- Feb 29, 2020
- 1 min read
Updated: Oct 20, 2020
How to create a tar file from local docker image and run it on local cluster
First check local images on you docker using command 'docker images'
Now make a tar file from the image using command 'docker save <imagename>:<image tag > -o <tar filename>'
FTP this tar file to local cluster
On cluster run command 'docker load -i <tar filename>'
Run 'docker images' on your cluster and verify image '<imagename>:<image' appears in list.
To get a bash shell in docker container
docker exec -it <docker id> /bin/bashwhere -i interactive. t means tty
How to ssh into docker machine
docker-machine sshCommonly used docker commands
Create docker image (Dockerfile is present in current folder)
docker build .Create docker image with tag (Dockerfile is present in current folder)
docker build -t myrepo/myimage:1.0 .List docker images
docker imagesList running docker containers
docker psList all docker containers, even which are not running
docker ps -aStop running docker container
docker stop <container id>Start stopped docker container.
docker start <container id>Remove docker image
docker rmi <image name>Remove docker container
docker rm <container id>Display information about a docker image
docker image inspect <image name>Display information about a container
docker container inspect <container id>Remove all unused docker images
docker image pruneRemove all unused docker containers
docker container prune
Comments