網頁

2017年2月25日 星期六

Docker Machine 0.9.0 --- Docker Machine install on the local client and manage Docker Engine on the remote host

Docker Machine is a tool that lets we install Docker Engine on virtual hosts and manager the hosts with docker-machine command.

By docker-machine command, we can start, inspect, stop and restart a managed host, upgrade the Docker client and daemon, and configure a Docker client to talk to the host next to run docker commands directly on this host.

In the moment, we will demo how to practice that docker machine manage the remote host.

Prerequisites
docker host never install a docker engine on the remote machine (# 1)
docker client   install docker client and docker machine on the local machine(as laptop)
where
OS in the remote need to be CentOS 7, Ubuntu 16.04 or above version
The net-tools package (# 2) need to be installed on the remote machine

[Remote Machine]
To create a docker manager account with new password (# 3)
$ sudo adduser {dockermanager}

To allow sudo for docker manager
In the remote machine, we have to edit the /etc/sudoers file and add the following content

                          {dockermanager}  ALL=(ALL) NOPASSWD:ALL
where
        {dockermanager} is the username on the remote machine
So do that Machine communicates with the hosts over password-less SSH

To check whether ssh daemon is running and is listening on port 22
$ sudo service ssh status
$ sudo netstat -anp | grep sshd
If it don't show the listening on tcp 0.0.0.0:22, we need to install openssh server
$ sudo apt-get update
$ sudo apt-get install openssh-server



[Local Machine]
To generate a public/private keys with empty passphrase (# 4)
$ ssh-keygen -t rsa
where
id_rsa.pub (RSA public key for authentication) file is the public key
id_rsa (RSA authentication identity of the user) file is the private key
In bash shell, the SSH key will be saved on ~/.ssh on linux platform

To copy a public key from local machine to a remote machine
$ ssh-copy-id -i ~/.ssh/id_rsa.pub {dockermanager}@{docker host}
where
{dockermanager} is the username on the remote machine
{docker host} is the ip address or host name of the remote machine

To connect the remote machine by using the SSH key
$ ssh {dockermanager}@{docker host}

To install Docker Client Tool
Until now, there is no docker client-only debs/rpms binary so that we need to do something for getting the individual binary. That is download the docker latest release next to extract it and execute docker command directly.


To install Docker Machine (# 5)
$ curl -L https://github.com/docker/machine/releases/download/v0.9.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine

$ chmod +x /tmp/docker-machine

$ sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

To check docker machine version
$ docker-machine version

To create the remote docker-vm using an existing VM/Host with SSH
$ docker-machine create \
 --driver generic \
 --generic-ip-address={remote docker host ip} \
 --generic-ssh-key ~/.ssh/id_rsa \
 --generic-ssh-user {dockermanager} \
 --generic-ssh-port 22 \
 --generic-engine-port 2376 \
{remote-docker-host}

To check which docker engine is active now
$ docker-machine ls

To print out the detail about the docker client to use the remote docker engine
$ docker-machine env {remote-docker-host}

To connect your shell to the new machine
$ eval $(docker-machine env {remote-docker-host})

To create a docker container on the remote docker host
$ docker run -d -p 8080:80 --name httpserver nginx
so do that any docker command you type at this command prompt will be executed on that remote host

Reference:
(# 1) How to prove that docker engine never is installed on this computer? To switch to the command path next to run $./docker ps command
(# 2) Installing net-tools package on Ubuntu 16.04 (Xenial Xerus) by running the following command on terminal
         $ sudo apt-get update
         $ sudo apt-get install net-tools
(# 3) We can change the account's password by running the following command on terminal
         $ sudo passwd {dockermanager}
(# 4)  If have already set a password for SSH passphrase, we have to change it by the following command
          To change directory to $HOME/.ssh         $ cd ~/.ssh/
          To change RSA passphrase                       $ ssh-keygen -f id_rsa -p
(# 5)  We can download the release version of docker machine from docker/machine release page.
(# 6)  Install Docker Machine https://docs.docker.com/machine/install-machine/
          Machine Driver Generic https://docs.docker.com/machine/drivers/generic/

2017年1月30日 星期一

Docker 1.13.0 --- How to install Docker on Lubuntu 16.10 x64

For a long time no go deep into the Docker's Knowledge!
Due to the job rotation, I have to spend some time to mange team member so that no time to write down something. In the duration of the Chinese holiday, I go to the Docker's Official Website to read the related document(# 1) and find out the some knowledge is a little different with before learning.
I will follow up the Docker's document to re-learn the installation step. For avoiding the forget memory in my mind, I will summary something as follows:

To remove the old Docker component if we ever install Docker or the system build in
$ sudo apt-get purge lxc-docker

To install extra packages for allowing Docker to use the aufs storage drivers
$ sudo apt update
$ sudo apt install curl linux-image-extra-$(uname -r) linux-image-extra-virtual

To install Docker by using the Docker's repositories
For setting up the Docker repository, we need to install some packages to allow apt to use a repository over HTTPS
$ sudo apt install apt-transport-https ca-certificates
and add Docker's official GPG key
$ curl -fsSL https://yum.dockerproject.org/gpg | sudo apt-key add -

and add the record of the stable repository into the /etc/apt/sources.list
$ sudo add-apt-repository "deb https://apt.dockerproject.org/repo/ ubuntu-$(lsb_release -cs) main"

To update the apt package index
$ sudo apt update

To verify the apt pull from the right repository
$ apt-cache policy docker-engine

To install the latest version of Docker(# 2)
$ sudo apt install docker-engine

To check Docker is running
$ sudo systemctl status docker

To verify the Docker is installed correctly
$ sudo docker run hello-world


Reference
(# 1). Get Docker for Ubuntu
(# 2). If we want to install a specific version of Docker Engine, not the latest version, we can use apt-cache madison command to list all available version.
$ apt-cache madison docker-engine
next to choose the the appropriate version
$ sudo apt-get install docker-engine=1.13.0-0~ubuntu-yakkety
(# 3). If we want to manage Docker as a non-root user, we need to create the docker group and add the specific user into this group.
To create the docker group
$ sudo groupadd docker

To add a logon user to the docker group
$ sudo usermod -aG docker $USER
Log out and log back again so that we can use docker command without sudo now.

2016年12月17日 星期六

VMware Workstation 12.5 --- How to install VMware Tools on Mac OS X guest

If we want to learn Mac OS X environment without Mac device, we can use the VM on VMware or Virtualbox to taste it. In Google, we can find out more and more method to tell us how to install it. I ever try to install Mac OS 10.10 on vmware or virtulabox, but the screen display is not good in virtualbox because it need to correct some parameter. As to vmware, it is very simple if we can install VMware tool on VM guest.
In the moment, I will show you how to install vmware tools on Mac OS X.

To download the latest version of VMware Tools for Mac OS X from VMware CDS repository for Fusion http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/

To extract com.vmware.fusion.tools.darwin.zip.tar until see the darwin.iso is placed on the "payload" folder

In the Virtual Machine Settings, to select use ISO image file by browsing darwin.iso

In the Mac OS X guest, the VMware Tools dialog box will appear so that click Install VMware Tools

It will trigger the installation of VMware Tool process so that we will click Continue button on Introduction tab.

On Destination Select tab still click Continue button

On Installation Type tab click Install button if we accept the default path.

Then key in the user name and password for installing new software.

To click Continue Installation button again

When the installation is successful, please click Restart button to finish the software installed.


2016年10月9日 星期日

Antivirus --- how to install Comodo x64 on Lubuntu/Ubuntu 16.04 x64

According to the experience of the Comodo install on Lubuntu 14.04, I think it will be very simple for installing on Lubuntu 16.04 and the procedure is "to download the source from Comodo Official WebSite(# 1) next to install it".
When I do it by my thought, I get the error message that it tell me the dependence package "libssl0.9.8" loss.

In Lubuntu 16.04, the libssl1.0.0 package is installed, not include libssl0.9.8.

Maybe we can install Libssl0.9.8 on 16.04 but does not replace the older one as well, I think. That is both package can be existed on the same operating system. Then I will browse directly the package repository by using Ubuntu Package Search

To do the search package, we have to firstly set the related condition as "libssl0.9.8" keyword、Search on packages names only、"any" distribution、"any" region and so on.

To select the specific architecture as "amd64" and the latest version of the package


To click the right architecture as "amd64" and begin to download the libssl0.9.8 package
and install it by using GDebi tool.

Once the above process finish and no any error message, we will install the Comodo package again by executing the sudo dpkg -i cav-linux_x64.deb command or GDebi mode and the result is normal now.

To execute the Comodo Antivirus program, we will see a "Filesystem filter driver is not loaded!" issue error.

How to fix this problem? To download driver.tar(redirfs 0.11E12A) from "redirfs,avflt,dazuko" WebSite (# 2) next to replace the original file.

In the moment, I will update the antivirus pattern next to fix it.

To go to folder where you downloaded the driver next to replace the  /opt/COMODO/driver.tar by using the sudo mv driver.tar /opt/COMODO/driver.tar command

To change the directory by using the cd /opt/COMODO command and install it by using the sudo ./post_setup.sh command.
Please follow the interactive mode as be careful at end of licence you NEED to accept with Y and then you can add email address, and choose Language 8 and so on.

Once the process finish and no any error, we have to restart the computer next to execute the initial scanning files/folders.



So does that the Comoda Antivirus is running on Lubutu 16.04 x64 normally.


Reference:
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.