CentOS configuration

We will mention here all the commands that we executed so that our OS in the VM is fully prepared.

First of all, if required, you can use the loadkeys command to set the keyboard language locale in your VM.

Next, in your VirtualBox, you can expose the ports (port forwarding) from inside the VM to the host environment so that they become accessible. For example, I exposed port 22 of CentOS VM outside, and mapped it to the host OS on port 3302 locally.

With this, I am now using PuTTY to SSH into my CentOS VM, as I type better on PuTTY over Windows.

Note that I am also using WinSCP for file transfers from the Windows host to the VM over SSH. WinSCP uses the same connection settings as PuTTY for secure file transfer.

Port Forwarding

The following screenshot shows all the exposed and mapped ports, which we will be needing sooner or later, to be accessible on the host OS. Please also enable other ports at your end:

Port Forwarding rules for CentOS VM

The general VM configuration is also visible in the last screenshot, which was basically the default when I imported the image into the VirtualBox. Also, the steps to reach the final screen are pretty much visible: you need to go to the VM settings, followed by then Network, and then click on the Port Forwarding button.

Packages installation

Basically, there are two main packages that we want to install on our CentOS VM:

  • Docker Engine
  • Azure CLI

First of all, we need to install GCC and the C++ compiler, which will be used by other packages later. Execute the following command on your CentOS terminal:

yum install -y gcc-c++ make

Docker installation

To have full information on installing Docker on CentOS, please visit
https://docs.docker.com/engine/installation/linux/centos/
.

Execute the following commands under CentOS (either on the terminal in the VirtualBox window or in PuTTY) in the same order as displayed here:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo

https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-engine (This is older command but still working)
sudo yum install docker-ce (This is a newer command)

Note that Docker runs as a privileged process, so you have to execute Docker commands as a root user, or perform the following steps to let your user added in a special Docker group on Linux:

sudo groupadd docker
sudo gpasswd -a coreos docker
sudo service docker restart

logout and then login again.

Now start the Docker daemon, the Docker service on the VM, by executing the following command:

sudo systemctl start docker

Your Docker is now installed and running. You can execute a tiny containerized application to test if it is successful:

docker run hello-world

It's a hello-world containerized application. See the output of the command; it confirms successful installation.

Azure CLI (command-line interface) Installation

We will now install the Azure CLI, and in order to do so, we first need to install NPM.

Login as root (for example, sudo bash), and execute the following command; notice the "-" in the end:

curl -sL https://rpm.nodesource.com/setup_7.x | bash -

You may now exit the root session, coming back to normal user, for example, centos (in my case), and execute the following command to install node.js so that the npm package manager becomes available:

sudo yum install -y nodejs

We are now ready to install the Azure CLI, so execute the following command, and we are done for now:

npm install -g azure-cli
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.179.220