Create your own hello-world image in Docker


  • Introduction
  • Write Dockerfile
  • Build the image
  • Run the image
  • Conclusion


Write docker file

  • From alpine is a minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size.
  • CMD: to execute the command once you run the docker container.

Build the image

docker build -t helloworld-custom .
  • t/ — tag gives a tag for your image

Run the image


docker container run helloworld-custom




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Software engineer, Problem solver, Geek.