On this blog, i will take you step by step on the process of building container image running on Docker Hub.
First lets have a brief understanding on what a container is
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
At the end of this article, you will have practical knowledge of what containerization is, and also be able to build your own.
To begin this project, ensure you have installed Oracle VM VirtualBox. If you haven't, locate my article "preparing my environment to for Containerization"
Now lets begin...
Login to your Linux VM by inputting your username and password
Now go ahead and open your Linux terminal
Click on ACTIVITIES, then on the search box, search for TERMINAL, click it open
Next, enter into root user with the command "sudo su" and press enter
You would be requested to input your password, note that your password will be kept invisible, do well to enter it correctly and enter
Input the "apt update" command to update install available software updates
Next step is to create your directory with the command "mkdir", leave a space and give your directory a name. MKDIR means Make Directory
To open the directory, use the command "cd", leave a space and type the directory name. Press enter
Use the "ls" command to see the files in the directory.. LS means to list
Next is to create our text file use the command "touch" followed by the file name.
Use the command "vi" to enter the file you have created.
Once you click on enter, the text file opens as shown in the image below.
Click the letter "i" to input your information
You can then go ahead to input the details you want.
To exit this editor, click "Esc" button on your PC, then ":wq" (column wq)
after you exit the editor, you can view the content of you file by using the "cat" command followed by the name of your file
Now we need to build our container image.
Input the command "docker build -t mydocker ."
Then press enter, your container image will start to build
Once its has finished building, you will see the "FINISHED" report
Top comments (0)