top of page
Search
Kiazsoft

Docker

Updated: Oct 20, 2020


 

How to create a tar file from local docker image and run it on local cluster

  1. First check local images on you docker using command 'docker images'

  2. Now make a tar file from the image using command 'docker save <imagename>:<image tag > -o <tar filename>'

  3. FTP this tar file to local cluster

  4. On cluster run command 'docker load -i <tar filename>'

  5. 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

44 views0 comments

Recent Posts

See All

Mac Useful Commands

Show hidden files in Finder Command + Shift + .

Git

Removing file from all history. git filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch PATH-TO-FILE" \...

MongoDB

Mongo Sample find query db.getCollection("user").find( { "username" : "kia" }, {//projections "username": 1.0, //1.0 means include...

bottom of page