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/bash
where -i interactive. t means tty
How to ssh into docker machine
docker-machine ssh
Commonly 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 images
List running docker containers
docker ps
List all docker containers, even which are not running
docker ps -a
Stop 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 prune
Remove all unused docker containers
docker container prune