From Windows to Ubuntu: A Guide to Installing WSL and Creating Your First Docker Image.
Windows to Ubuntu: WSL & Docker Image Guide

Full Stack Developer | Node.js, MongoDB, PostgreSQL, Docker, AWS | Exploring AI, Workflow Automation & AI Agents | Sharing backend tips, dev tools & learning in public 🚀
To get started, first, install Docker Desktop for Windows by following this link. This is the initial step.
Next, install WSL and Ubuntu from the Microsoft Store. Then, search for "Turn Windows features on or off" in the Windows search bar.
In the "Windows Features" dialog that appears, ensure that both "Virtual Machine Platform" and "Windows Subsystem for Linux" are checked (turned on). If they are not already enabled, check the boxes next to them and click "OK."
After completing these steps, you'll have Docker Desktop installed, WSL activated, and the necessary Windows features enabled to work with Docker and Ubuntu on Windows.

Now First, open Ubuntu and create a user and password. After creating, your prompt will look something like username@yourlaptop:~$.
To verify your current location, type
pwdand it will display/home/yourUsername.Next, you need to mount your
Cdirectory into Ubuntu. To do this, run the commandcd /mnt/c.Now, the important part is to configure Docker Desktop. Go to Docker Desktop's settings, then navigate to "Resources" and choose "WSL Integration."
Enable integration with the default WSL distro by toggling on the switch for Ubuntu.
For more info visit this link

Now, let's create our own Dockerfile. Begin by opening Ubuntu and creating a file using the command: touch Dockerfile. After creating the file, you can edit it from the command line using the vi text editor. To do this, enter the command: vi Dockerfile.
When you're in the vi editor, press the i key to enter the "insert" mode, allowing you to make changes to the file. Write the content of your Dockerfile. Once you've finished editing, click the Esc key to exit the insert mode.

To save your changes, type :w and press Enter. This will write and save the changes made to the Dockerfile.
Finally, to exit the vi editor, type :q and press Enter. This will safely exit the editor, leaving you back in the Ubuntu command line.
By following these steps, you will have created and edited your own Dockerfile using the vi text editor in Ubuntu.
To create an image from the Dockerfile, use the build command as follows:
docker build -t myimage .
In this command, docker build is the command to build the image. The option -t is used to specify the tag name for the image, which in this case is myimage. The dot . at the end represents the current directory, indicating that the Dockerfile is located in the current directory and should be used for building the image.

To run a Docker image, use the docker run command followed by the name of the image:
docker run <image_name> Replace <image_name> with the name of the Docker image you want to run.



