Sunday, November 26, 2017

Running Docker in my OrangePi Lite


Fascinated to mini PC for sometimes already. Only recently have some free time to play around with my long purchased OrangePi Lite. As an alternative for Raspberry Pi, I got my H3 ARM, Cortex-A7 Quad Core, 512mb RAM OrangePi Lite, for less than USD$14. After tried several way which didn't work, i have found the following setup are able to run Docker : 

1. download the armbian server image using the following link :
    https://www.armbian.com/orange-pi-lite/
2. burn the image using Win32DiskImage into a SD card with minimum 8GB storage
3. Plugin the SD card into the OrangePi Lite slot and start the OrangePi.
4. Following the instruction on the screen to configure your account and finally reboot the device. 
5. Run "armbian-config" to configure WIFI connection.
6. Within armbian-config, switch to use to use Dev builds instead of stable build.
7. run apt-update and then apt-upgrade.
8. reboot the device. After reboot, we are ready to setup docker.
9. Use the following steps to setup docker :
    i. Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

    ii. Add Docker’s official GPG key:



$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    iii. Verify that you now have the key with the fingerprint:
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88,
 by searching for the last 8 characters of the fingerprint.
$ sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) 
sub   4096R/F273FCD8 2017-02-22
    iv. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or testrepository, add the word edge or test (or both) after the word stable in the commands below.
Note: The lsb_release -cs sub-command below returns the name of your Ubuntu distribution, such as xenial. Sometimes, in a distribution like Linux Mint, you might have to change $(lsb_release -cs) to your parent Ubuntu distribution. For example, if you are usingLinux Mint Rafaela, you could use trusty.
armhf:
$ sudo add-apt-repository \
   "deb [arch=armhf] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
    v. Install the latest version of Docker CE, or go to the next step to install a specific version. Any existing installation of Docker is replaced.
$ sudo apt-get install docker-c

    vi. Verify that Docker CE is installed correctly by running the hello-world image.
$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.




Monday, November 20, 2017

Raspbian Pi for ORange Pi - Fully expand SD space

Following are the steps to expand the SD space within Raspbian Pi running in My Orange PI :

root@orangepi:~# fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 15.8 GB, 15804137472 bytes
4 heads, 16 sectors/track, 482304 cylinders, total 30867456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x34605ba5

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1           40960      124927       41984   83  Linux
/dev/mmcblk0p2          124928     7170047     3522560   83  Linux

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-30867455, default 2048): 124928
Last sector, +sectors or +size{K,M,G} (124928-30867455, default 30867455): 
Using default value 30867455

Command (m for help): w

Theen quit (command q), reboot. You will then be able to use resize:

resize2fs /dev/root

df -h