Docker
in blog
Getting Started
Download from Docker Hub
- Start
docker desktop for windows
- Test your installation
- open a terminal window (command prompt)
- run
docker --version
to ensure that you have a support version of docker> docker --version
- pull the hello-world image from docker hub and run a container
> docker run hello-world
- list the
hello-world
image that was downloaded from docker hub> docker image ls
- list the
hello-world
container(thar exited after displaying “hello from docker!”)> docker container ls --all
Explore the application
- ubuntu os
- pull an image of the ubuntu OS and run an interactive terminal inside the spawned container
> docker run --interactive --tty ubuntu bash or > docker run -it ubuntu bash
- you are in the container. At the root
#
prompt, check thehostname
of the containerroot@:/ # hostname root@:/ # exit >
- list containers with the –all option
> docker container ls --all
- pull an image of the ubuntu OS and run an interactive terminal inside the spawned container
- nginx webserver
- pull and run a Dockerized nginx web server that we name,
webserver
:> docker run --detach --publish 80:80 --name webserver nginx
- point your web browser at
http://localhost
to display the nginx start page - List only your running containers:
> docker container ls
- stop the running nginx container by the name we assigned it,
webserver
> docker container stop webserver
- remove all three containers by their names:
> docker container rm webserver
- pull and run a Dockerized nginx web server that we name,
Getting Started with Docker
- Part 1: Orientation and setup
- docker concepts
- images and containers: a
container
is launched by running animage
image
is an executable package that includes everything needed to run an application
container
is a runtime instance of an image - Containers and virtual machines
container
runs natively on linux and shares the kernel of the host machine with other containers.
virtual machine
runs a full-blown ‘guest’ operating system with virtual access to host resources through a hypervisor.
- images and containers: a
- prepare your Docker environment
- docker concepts
- Containers
- Services
- Sawrms
- Stacks
- Deploy your app