Docker Community Forums

Share and learn in the Docker community.

First time user of Docker , need some answers


(Ahmmud16) #1

Hi !

When i type: sudo docker images , it shows me 3 images.

And when i type: sudo docker ps -a , it shows me 4 containers

And when i type: sudo docker info , i get a long output, but look here


First question: Can i delete the images and containers without no harm?

Second question: Containers is 4, and when i typed ‘sudo docker images’ i get 3 but ‘sudo docker info’ tells me what is 8 images ? Why is that?

Third question: How to use docker without typing ‘sudo’ all the time ?

(Nitikishu) #2

Yes, you can delete unused images by using

> docker image prune

docker images shows the list of images which you created in docker
images :8 means it has 8 images(application) in docker

you can see the what are all the images in docker by using
docker command:
docker images

which os you are using ? in linux docker command is use with prefix of sudo

(Ahmmud16) #3

I’m using Ubuntu 16.04 , had been awesome if i can avoid ‘sudo’ for all docker commands, or is it not recommended to remove the ‘sudo’ ? Thanks a lot for helping me out !

(Nitikishu) #4

I hope this link will help you