Difference between revisions of "Docker"

From John Freier
Jump to: navigation, search
Line 10: Line 10:
 
   docker images
 
   docker images
  
""Remove""
+
'''Remove'''
 
This will remove an image from the list.
 
This will remove an image from the list.
 
   docker rmi {imagename}:{tag}
 
   docker rmi {imagename}:{tag}

Revision as of 14:43, 6 September 2019

This is a page all about Docker and helpful commands.

Docker File

Docker Images

List This will show a list of all docker images.

 docker images

Remove This will remove an image from the list.

 docker rmi {imagename}:{tag}

You might need to force it.

 docker rmi -f {imagename}:{tag}

""Run"" This is how you run an image

 docker run -it {imagename}:{tag}

To open the ports

 docker run -p 8080:8080 -it {imagename}:{tag}

To run the image in a detacted container for it run in the background.

 docker run -d -it {imagename}:{tag}

To run an image and go right into bash for the starting point.

 docker run -it --entrypoint "/bin/bash" {imagename}:{tag}

To get into bash for a container.

 docker exec -it <container id> /bin/bash