Get started with Docker on Windows – Tutorial 1

  • First you need to have docker platform (docker toolbox) installed in your computer.

You need to have an account created in docker hub to download the docker toolboxIf you do not have enterprise or professional windows 10 https://docs.docker.com/toolbox/overview/
else https://hub.docker.com/editions/community/docker-ce-desktop-windows

  • Run docker Toolbox setup with default configuration

choose options “Git for windows” “Install VirtualBox with NDIS5” and “install the device software (always trust oracle publisher)”

  • Run Docker Quickstart Terminal
      Allow all the permissions for VBox  

You”ll have docker terminal where you can run docker commands

1. Download a docker image (This means an instance of OS with or without pre-installed application)

$ docker pull ubuntu

2. List all local containers

$ docker ps -a            ; no container will be shown until you run the downloaded image locally

3. List local images

 $ docker images 

4. Let’s create a container out of the above image (you need to create only once)

$ docker run --name test-ubuntu -it ubuntu bash  ;You'll be logged into the created container
$ exit

5. Try listing containers again

$ docker ps -a         ; you'll see the new container with the name "test-ubuntu"

6. Let’s start and log in to the container

$ docker start test-ubuntu
$ docker exec -it test-ubuntu bash  

Now you’re in the Linux container where you can run linux commands

Do any modifications to your container. For example, create users, install applications etc.. Anything you do on a physical machine, then exit.

#exit

7. Commit your changes

$ docker commit -m "new test docker" -a "auther name" CONTAINER-ID DOCKER-USERNAME/A-DOCKER-NAME:SOME-TAG

8. Log in to your account

$ docker login -u DOCKER-USERNAME

9. Push your commit to Docker Hub

$ docker push  DOCKER-USERNAME/A-DOCKER-NAME:SOME-TAG

Now you can explore your image in Docker hub and pull from any client dockers.

Be the first to comment on "Get started with Docker on Windows – Tutorial 1"

Leave a comment

Your email address will not be published.


*