The beauty of Docker is that you can run a very lightweight image of another Linux distro on your host system. In this post we will be pulling the latest image of CentOS into our docker container on our Ubuntu server.
Step-by-Step:
1. Open the terminal in Ubuntu, then make sure docker is running by typing service docker status, you should see something a message like the image below
2. Type in the following command docker run --name test -it centos /bin/bash . The command tells Ubuntu to run docker with the name dev in interactive mode with an emulated terminal using the CentOS image with the bash shell. If there's no local image docker will pull the latest image from CentOS
3. After the command is completed you will running inside the CentOS container, you can tell by the changes in the prompt
4. The weird number is in the prompt is the image ID of the CentOS image that we pulled. If you type service docker status you will get an error message saying it does not recognize the command because docker is installed in the host machine not the CentOS image
5. To get out of the CentOS container just type exit and you will get back to the host system
Showing posts with label Virtualization. Show all posts
Showing posts with label Virtualization. Show all posts
Wednesday, July 27, 2016
Tuesday, July 26, 2016
Docker : Pull The Latest Fedora Image Into A Ubuntu Server
The beauty of Docker is that you can run a very lightweight image of another Linux distro on your host system. In this post we will be pulling the latest image of Fedora into our docker container on our Ubuntu server.
Step-by-Step:
1. Open the terminal in Ubuntu, then make sure docker is running by typing service docker status, you should see something a message like the image below
2. Type in the following command docker run --name dev -it fedora /bin/bash . The command tells Ubuntu to run docker with the name dev in interactive mode with an emulated terminal using the Fedora image with the bash shell. If there's no local image docker will pull the latest image from Fedora
3. After the command is completed you will running inside the Fedora container, you can tell by the changes in the prompt
4. The weird number is in the prompt is the image ID of the Fedora image that we pulled. If you type service docker status you will get an error message saying it does not recognize the command because docker is installed in the host machine not the Fedora image
5. To get out of the Fedora container just type exit and you will get back to the host system
Step-by-Step:
1. Open the terminal in Ubuntu, then make sure docker is running by typing service docker status, you should see something a message like the image below
2. Type in the following command docker run --name dev -it fedora /bin/bash . The command tells Ubuntu to run docker with the name dev in interactive mode with an emulated terminal using the Fedora image with the bash shell. If there's no local image docker will pull the latest image from Fedora
3. After the command is completed you will running inside the Fedora container, you can tell by the changes in the prompt
4. The weird number is in the prompt is the image ID of the Fedora image that we pulled. If you type service docker status you will get an error message saying it does not recognize the command because docker is installed in the host machine not the Fedora image
5. To get out of the Fedora container just type exit and you will get back to the host system
Labels:
Container,
Docker,
Infrastructure,
Linux,
Ubuntu,
Virtualization
Thursday, July 21, 2016
Docker : Adding Docker Repository Key and Updating Docker To The Latest Version
In the previous post we installed Docker on our Ubuntu server. Now we are going to add the Docker repository to our local server so that we can get the latest version of Docker.
Step-By-Step Instructions:
Step-By-Step Instructions:
- Open the terminal command line tool and switch to root user with the sudo su command
2. Now we have to add the Docker repo key to our local machine by typing the following command
wget -qO- https://get.docker.com/gpg | apt-key add -
3. The next command is to add the Docker repository to the Ubuntu repository source list. Type the following command into the terminal:
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
4. Now type apt-get update to get the latest updates from the Docker repository. If you haven't ran update for a while. This might take a while.
5. After the update has completed type docker -v to the version number
3. The next command is to add the Docker repository to the Ubuntu repository source list. Type the following command into the terminal:
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
4. Now type apt-get update to get the latest updates from the Docker repository. If you haven't ran update for a while. This might take a while.
5. After the update has completed type docker -v to the version number
Labels:
Container,
Docker,
Linux,
Ubuntu,
Virtualization
Tuesday, July 19, 2016
Installing Docker On Ubuntu Server
Docker is the hottest infrastructure technology to hit the tech world in a long time. The appeal of Docker is that it allows the infrastructure team to utilize the capacity of the servers to near full capacity. Docker is a container. A container is like a micro virtualization minus the operating system. It only contains enough infrastructure to host an app, without the fat. Hence the term container is used to describe it.
Here are the steps to install Docker on a Ubuntu Server:
1. Open the Ubuntu terminal, then type the following command to switch to the super user:
sudo su
2. Now get the latest update for Ubuntu by typing apt-get update
3. To install Docker type the following command in the terminal
apt-get install -y docker.io
4. Once the installation is complete type service docker status
Now we have Docker installed and running on Ubuntu. It was pretty simple wasn't it?
Here are the steps to install Docker on a Ubuntu Server:
1. Open the Ubuntu terminal, then type the following command to switch to the super user:
sudo su
2. Now get the latest update for Ubuntu by typing apt-get update
3. To install Docker type the following command in the terminal
apt-get install -y docker.io
4. Once the installation is complete type service docker status
Now we have Docker installed and running on Ubuntu. It was pretty simple wasn't it?
Labels:
Container,
Docker,
Infrastructure,
Linux,
Virtualization,
Web Development
Sunday, June 19, 2016
Install CentOS ISO on VirtualBox Part 2 : Install the CentOS Operating System
On the previous blog we went over how to create a new virtual machine for CentOS in VirtualBox. In this blog we will go over how to install the CentOS ISO file on the new virtual machine that we've just created. Below are the step by step instructions of how to install CentOS on VirtualBox.
Step-By-Step Instructions:
1. Launch VirtualBox, right-click then select "Settings"
3. Select the "Empty" disc icon, the right hand side will change to "CD/DVD Drive", click on the disc icon next to the drive, like the screen shoot below.
4. Browse to the CentOS ISO file that you've just downloaded in the previous blog. Select the .iso file then click on the "Open" button.
5. The disc icon will now have the CentOS iso file mounted, click on the "OK" button
6. In VirtualBox, click, right click on the CentOS machine and click "Start"
13. In the next screen select the default settings and click "Done". This screen just allows you to configure your virtual hard disk. You can choose to encrypt the hard disk or create another partition on the disk if you want on this screen, but for now we just want to keep things simple so we will keep the default settings. I have given my VM a disk space of 64 GB
16. The next step is that you have to enable the network by click on the "NETWORK & HOST NAME" setting
17. In the "NEWTORK & HOST NAME" screen make sure you have the following settings. This is the steps that most people forget to do. CentOS does not enable networking by default you can do it manually on the command line, but doing it during the install is much easier.
18. We are now ready to proceed with the installation. Click on the "Begin Installation"
19. On the next screen you will be prompted to set the root user's password, and create a default user before you can proceed, so click on the "Root Password" icon first
You now have CentOS installed in your Oracle VirtualBox. In the next blog we will go over how to install a lightweight desktop GUI to our CentOS.
27. After logging in, type "sudo yum update" to install the latest updates
Step-By-Step Instructions:
1. Launch VirtualBox, right-click then select "Settings"
2. Click on "Storage", you will see the disc icon is "Empty"
4. Browse to the CentOS ISO file that you've just downloaded in the previous blog. Select the .iso file then click on the "Open" button.
5. The disc icon will now have the CentOS iso file mounted, click on the "OK" button
6. In VirtualBox, click, right click on the CentOS machine and click "Start"
7. An Installation screen will appear press the "I" key to choose the installation option, which is the first option on the screen. Then press "Enter"
8. The CentOS iso file will be run to install the CentOS operating system
9. In the welcome screen select "English" as the language for the installation.
10. Then click "Continue"
11. A prompt will come up to say that your mouse will be captured in the virtual machine, check "Do not show this message again", then click "Capture". Make a note that host key is defined as the "Right Ctrl" key. This key will allow you to release the mouse from the virtual machine when you want your mouse click back on the host machine.
12. If you see the red warning text on the "INSTALLATION DESTINATION" icon click on the icon
14. Now the red warning text is gone because we've confirm the hard disk configuration
- Host name: your host name goes here
- Make sure networking is turned on
- Click "Done" when you are done
18. We are now ready to proceed with the installation. Click on the "Begin Installation"
19. On the next screen you will be prompted to set the root user's password, and create a default user before you can proceed, so click on the "Root Password" icon first
20. Set the root user's password in the "Root Password" and "Confirm" form fields, make sure the password string are the same in both form fields, then click on the "Done"
21. Now the "Root Password" icon is set to blue instead of red, we can continue with the installation now, however we want to set up a default user so that we don't have to use the root user if we don't have to, so click on the "User Creation" icon
22. Type in the user's name in the "Full name" form field, the "User name" field will be auto populated, just accept the default user name. Then check the "Make this user Administrator" check mark. Click "Done" to create a new user.
23. After you finish creating the user you will see "Finish configuration" button. Click on it.
24. You will get the "Complete" and "Reboot" button, click on the "Reboot" button to reboot the virtual machine
25. After a system reboot, a text login prompt is displayed
26. Login with the user that you created during the installation.
27. After logging in, type "sudo yum update" to install the latest updates
Install CentOS on VirtualBox Part 3 : Installing the Gnome Desktop Environment
In previous blog we've installed the CentOS operating system on VirtualBox however, when we reboot, it takes us to a text prompt. In this blog we will be installing a graphical desktop environment to our operating system using "yum". Follow the steps below to get the Gnome desktop in your CentOS.
1. Make sure you have internet connection
2. Click "Start" on your "CentOS" VM
3. After the boot messages you will be presented with login prompt. Type in the login name of the Administrator user that you've created on the last blog.
6. Now type sudo yum groupinstall "GNOME Desktop" without the quotes
7. Type y when asked "Is this ok [y/d/N]
8. After the Gnome desktop has been installed type reboot now -r to reboot CentOS
10. Now to see the installation work type sudo systemctl start graphical.target to start the Gnome Desktop
11. The Gnome Desktop login screen will appear
12. Login and to start using the Gnome Desktop
1. Make sure you have internet connection
2. Click "Start" on your "CentOS" VM
3. After the boot messages you will be presented with login prompt. Type in the login name of the Administrator user that you've created on the last blog.
6. Now type sudo yum groupinstall "GNOME Desktop" without the quotes
7. Type y when asked "Is this ok [y/d/N]
8. After the Gnome desktop has been installed type reboot now -r to reboot CentOS
9. After the CentOS has been rebooted, login using the Administrator user and type sudo systemctl set-default graphical.target this step is optional. You only want to do this if you want to start up CentOS in desktop mode.
11. The Gnome Desktop login screen will appear
12. Login and to start using the Gnome Desktop
Subscribe to:
Posts (Atom)

















































