Hello World with Docker: Learning Docker and Containers.

In our last article we talked about dockers and containters. Here we are going to say do hello world in docker. For this we need to install docker and see few basic commands of docker.

Hello World with Docker

Installation

You can download docker from here https://www.docker.com/docker-ubuntu. Or you can also use these instructions to install docker in your ubuntu.

Also install Kitematic as this will give you an ui to manage and change settings of your docker conatiners.

Follow this link to install kitematic

For docker to work we need to make a Dockerfile which contains info what to run in container. Create a docker file

touch Dockerfile

Now open this file in you favourite editor and paste the following in Dockerfile.

FROM alpine
CMD echo "hello-world"

After saving the file run the below command to build your container. This command will download required containers from docker hub and use them. You will see some output like the below after these commands.

Hello World with Docker.

Now that you have build your container. Its time to run it.

docker run hello

Docker will run your container and then you can see the output in your terminal.

You can also do all these using Kitematic. Below is the screenshot of the kitematic dashboard.

Hello World with Docker.

Here you can see your containers listed. Also there are many other options like start, restart, stop also settings in top right corner. It container options related to network, volumes, Host port etc.

Now that you have seen hello world in Docker, try experimenting with it and comment in below if you are stuck some where. I am also a beginner but I will try to find solution for your problem.

More articles on Docker and containers will be coming soon. Follow this blog to get status of any new articles.

To access articles related to docker follow the below link.

https://www.learnsteps.com/category/technology/docker-technology/

This is the end of Hello World with Docker.


Gaurav Yadav

Gaurav is cloud infrastructure engineer and a full stack web developer and blogger. Sportsperson by heart and loves football. Scale is something he loves to work for and always keen to learn new tech. Experienced with CI/CD, distributed cloud infrastructure, build systems and lot of SRE Stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.