Dockfolio Unveiled: Comprehensive Guide to Creating and Sharing Docker Image
Tags: docker, dockerimage, portfolio
Published: 2023-12-12 10:34:28



## **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:
    
    ```bash
    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`
    
    ```bash
    tar czvf dockfolio.tar.gz dockfolio/*
    ```
    
* Create dockerfile with dependencies and configuration.
    
    ```bash
    touch Dockerfile
    vim Dockerfile
    ```
    
    ![Making changes into Dockerfile  | Dockfolio | @pranjal-barnwal](https://cdn.hashnode.com/res/hashnode/image/upload/v1702374832676/8dd6fb2a-3d6e-458c-84f3-ebaa72f71cbe.png)
    
* Weave a tapestry of configurations—Apache service—to build the perfect environment.
    
* **Building the Image:** With a flick of a command:
    
    ```bash
    docker build -t pranjalbarnwal/dockfolio .
    ```
    
    ![Build process for our docker image  | Dockfolio | @pranjal-barnwal](https://cdn.hashnode.com/res/hashnode/image/upload/v1702374391910/56d50482-01da-4bb3-a513-78e6b3bcd4d7.png)
    
* 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:
    
    ```bash
    docker login
    ```
    
    Claim your spot among fellow creators.
    
* **Tagging and Pushing:** Give your creation wings by tagging it:
    
    ```bash
    docker tag dockfolio pranjalbarnwal/dockfolio:latest
    ```
    
    Set it free into the world:
    
    ```bash
    docker push pranjalbarnwal/dockfolio:latest
    ```
    

![Push digest and process shown here | Dockfolio | @pranjal-barnwal](https://cdn.hashnode.com/res/hashnode/image/upload/v1702374187200/34d55858-5e74-4cdb-8f55-ec6e3544aa96.png)

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

![Image on Docker Hub | Dockfolio | @pranjal-barnwal](https://cdn.hashnode.com/res/hashnode/image/upload/v1702367467166/4fdf8bcc-c657-4902-982e-d2e04f243720.png)

## Running image from Docker Hub

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

```bash
# 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](http://localhost:8080)
> 
> **NOTE**: if you're running Docker on server, then replace [localhost](http://localhost) above with your ip address ex: [`http://54.80.107.150:8080`](http://54.80.107.150:8080)

![Deployment of Dockfolio](https://cdn.hashnode.com/res/hashnode/image/upload/v1702367398185/496e4ee7-b075-4a80-8a65-53ce6fef8898.png)

## **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**](https://github.com/pranjal-barnwal/dockfolio)
    

## **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

* **Docker Image:** [pranjalbarnwal/dockfolio](https://hub.docker.com/repository/docker/pranjalbarnwal/dockfolio)
    
* **Repo:** [github.com/pranjal-barnwal/dockfolio](https://github.com/pranjal-barnwal/dockfolio)
    
* **Docker docs:** [docs.docker.com](https://docs.docker.com/build/building/base-images)