Docker
Dockerfile
File named dockerfile with no file extension that contains instructions for building the image.
Help
run docker to see a list of commands. Then docker <command> --help to get help on individual commands.
Pull to pull an image or build to build from a dockerfile
- docker pull mcr.microsoft.com/powershell:lts-debian-10
- pulls image mcr.microsoft.com/powershell with tag lts-debian-10
- docker build -t linux-powershell .
- builds from dockerfile in current folder (".") and tags with linux-powershell.
This generates an image. Then it needs to be Run or Created to get a container which can then be started.
Run to create and start or start to just start an existing containter
- docker run -it --name linux-powershell linux-powershell
- creates and starts a docker container based on given image, names it linux-powershell and sets it to interactive so standard in/out is written from/to console.
- can also be a remote image: docker run -it --name linux-powershell mcr.microsoft.com/powershell:lts-debian-10
- docker start -i linux-powershell
- starts the container mentioned above.
See also rancher