Fun with Docker

Is installing docker in your machine stopping you from trying docker?

Chandra Sharma
3 min readJul 9, 2021
Photo by Dominik Lückmann on Unsplash

Are you looking for docker hands-on but restricted by following:

  • Office laptops not allowing Docker Desktop installation
  • Don’t want to over-load your personal laptop
  • Just want to see the power of docker and planning to deploy to your personal machine once comfortable

If yes, this article is for you. So, let’s get started.

Without any fuss, all you need to have is “Internet Connection” and “Docker ID”. Go to the below link which will take you to Docker Playground.

Docker Hub Login
Docker Hub Login

Once you are able to login you will see the below screen. You just need to click on start button.

Logged in successfully
Logged in successfully
Docker Playground session started
Docker Playground session started

From here, you can create multiple instances. Let’s create one by clicking on “Add New Instance”.

Docker instance created
Docker instance created

Hurray!! We are now having superfast docker instance up and running. Now you can try out all the docker commands from here and even run docker images.

Trying out Docker commands

  1. docker version — This command will tell the version of the docker available.

** Bonus — Alt+Enter will make the CLI in full screen.

docker version
docker version

2. docker pull — This command will pull the docker image from docker container registry.

docker pull command
docker pull command

3. docker images — This will list all the images available in your local repository.

docker images
docker images

4. docker run — With this command we can run the docker image locally.

docker run
docker run

Here, you can few flags:

  • -p 8080:7080 — This is for port mapping where container port is exposed to host port. You can see the port number which is opened as a hyperlink.
  • -d — This is for running the containers in the background.

5. docker container ls — If you want to list your containers.

docker container ls
docker container ls

6. docker logs <container ID/ Name>— You can use this command if you want to check the logs for the container.

docker container logs
docker container logs

Summary

We have learnt about docker playground, how to start the session, create instances and trying out commonly used docker commands.

Happy Reading!!

Here is the YT video if you want to see it in action.

--

--

Chandra Sharma

I am a technology explorer who loves to read, hands-on and share the knowledge gained.