Skip to main content

Dockfolio: Guide to Creating and Sharing Docker Image

Docker: pranjal-barnwal | Pranjal Blogs: pranjal-barnwal | Pranjal Kumar, Hazaribag Jharkhand | SWE Bentley Systems

Introduction

Prepare for an exhilarating journey into the world of "dockfolio," a comprehensive Docker image created to simplify Portfolio creation for developers. This article is your personalized roadmap, guiding you through every step, command, and thrill involved in curating and distributing a Docker image.

The Birth of Dockfolio: The genesis of "dockfolio" emerged from a passionate pursuit to streamline the intricate process of web development deployment of a Developer Portfolio. It's a brainchild designed to be your all-in-one, hassle-free toolkit, blending a medley of essential tools to supercharge your development environment.

Crafting the Container:

  • Creating the Dockerfile: To give life to "dockfolio," start by crafting your Dockerfile. Open the door to your imagination with commands like:

    mkdir dockfolio
    cd dockfolio
  • Add desired files into your this repo, add your web-dev files into it. (HTML, CSS, Js, etc.)

  • Compress and archive it into a tar ball using: tar & gzip

    tar czvf dockfolio.tar.gz dockfolio/*
  • Create dockerfile with dependencies and configuration.

    touch Dockerfile
    vim Dockerfile

    Making changes into Dockerfile  | Dockfolio | @pranjal-barnwal

  • Weave a tapestry of configurations—Apache service—to build the perfect environment.

  • Building the Image: With a flick of a command:

    docker build -t pranjalbarnwal/dockfolio .

    Build process for our docker image  | Dockfolio | @pranjal-barnwal

  • Watch as your masterpiece comes to life, each line of code infused with purpose and precision.

Navigating Challenges, Embracing Victories:

  • Overcoming Configuration Hurdles: A journey fraught with challenges! But fear not, for every configuration tweak brings a step closer to harmony among components.

  • Fine-Tuning Performance: The quest for excellence doesn’t stop. Optimize your image for lightning-fast efficiency, ensuring it performs like a well-oiled machine.

Publishing on Docker Hub:

  • Docker Hub Login: Enter the gateway to the Docker universe:

    docker login

    Claim your spot among fellow creators.

  • Tagging and Pushing: Give your creation wings by tagging it:

    docker tag dockfolio pranjalbarnwal/dockfolio:latest

    Set it free into the world:

    docker push pranjalbarnwal/dockfolio:latest

Push digest and process shown here | Dockfolio | @pranjal-barnwal

With this, our image is live and public at Docker Hub.

Image on Docker Hub | Dockfolio | @pranjal-barnwal

Running image from Docker Hub

Now anyone will be able to fetch the image and run the same image using below commands

# pulling the latest image of dockfolio from Docker Hub
docker pull pranjalbarnwal/dockfolio

# running the container and connecting the ports
docker run -d -p 8080:80 pranjalbarnwal/dockfolio

Once done, website will be live at: localhost:8080

NOTE: if you're running Docker on server, then replace localhost above with your ip address ex: http://54.80.107.150:8080

Deployment of Dockfolio

Engagement and Improvement

  • Joining the Docker Community: Dive into vibrant discussions, seek counsel, and share insights to grow together within the nurturing Docker community.

  • Iterative Enhancements: Feedback is a gift! Continuously enhance dockfolio based on community suggestions, evolving it into a tool that resonates with developers worldwide.

    Feel free to bring improvements and dive into the sea of Open-source: Repo

Charting the Future

  • Evolving "Dockfolio": The journey doesn’t end here! As we move forward, envision endless possibilities—innovative integrations, enhanced functionalities—enriching the landscape of development efficiency.

Conclusion: "Dockfolio" encapsulates a voyage—beyond just an image—of persistence, learning, and community camaraderie. Dive into its world, contribute, and immerse yourself in the transformative domain of containerization and efficient development workflows.

Final Thoughts: As this chapter concludes, heartfelt gratitude is extended to the vibrant Docker community for their unwavering support and collective wisdom. Remember, every Docker command, every interaction, fosters collaboration and fuels innovation.


References