Docker: Difference between revisions
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
* List of all images: docker image ls | * List of all images: docker image ls | ||
* Remove an image: docker rmi <image-id> | * Remove an image: docker rmi <image-id> | ||
* Remove all dangling images: docker image prune | |||
* Create a new container (from an image): docker create jatzoo/jrivermc24 | * Create a new container (from an image): docker create jatzoo/jrivermc24 | ||
* Create a new container (from an image) and run a command in it: docker run -d --name=jrivermc24--stable --net=host -e VNCPASS=foobar -v /volume1/Public/music:/mnt/media jatzoo/jrivermc24:latest | * Create a new container (from an image) and run a command in it: docker run -d --name=jrivermc24--stable --net=host -e VNCPASS=foobar -v /volume1/Public/music:/mnt/media jatzoo/jrivermc24:latest |
Revision as of 17:51, 25 November 2021
This is a short tutorial to use Docker.
Basic commands
- List of all containers: docker ps -a
- Remove a container: docker rm <container-id>
- Remove all stopped containers: docker container prune
- List of all images: docker image ls
- Remove an image: docker rmi <image-id>
- Remove all dangling images: docker image prune
- Create a new container (from an image): docker create jatzoo/jrivermc24
- Create a new container (from an image) and run a command in it: docker run -d --name=jrivermc24--stable --net=host -e VNCPASS=foobar -v /volume1/Public/music:/mnt/media jatzoo/jrivermc24:latest
Building an image
- docker build -t app-name .