Monday, April 18, 2022

docker commands

  • docker -version

checking current installed docker version

  • docker container run hello-world

run hello-world docker image. if image is not available in local repository, above command will download the image from docker-hub

  • docker run -it ubuntu bash
run ubuntu container in docker.
  • docker ps
list running docker container
  • docker image  build -t hello-world:1.0 .
use above command for buid a docker image. (here . means Dockerfile contains in the current directory)
  • docker container run hello-world:1.0
use below command for run above docker image.
  • docker image ls
list images in local repository

No comments:

Post a Comment