Oct 15, 2014
TechnologyThe guideline I follow is from :
https://wiki.archlinux.org/index.php/Docker
Working behind Proxy
When docker runs under the proxy, it will be blocked by the firewall, thus in the ArchLinux we have to kill the systemd started docker daemon, and manually set the proxy configuration for the docker daemon, following is the tips:
$ systemctl stop docker.service
$ sudo HTTP_PROXY=http://1xx.*.*.2xx:2xx3 docker -d &
Then you run the docker for create the new machine will be OK.
Default Configuration
That leads me for thinking the default configuration of ArchLinux , change it to :
$ cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
ExecStart=/usr/bin/docker -d
LimitNOFILE=1048576
LimitNPROC=1048576
[Install]
Also=docker.socket
Add following line, but failed, Arch Wiki also indicates its failure:
[Service]
Environment="http_proxy=192.168.1.1:3128"
ExecStart=
ExecStart=/usr/bin/docker -d -g /var/yourDockerDir
So everytime you want to enable proxy, simply manually reload it.
Then reload the service status and restart the docker.service:
sudo systemctl daemon-reload
sudo systemctl restart docker.service
Test the docker to view if it runs well:
$ docker info
Docker Management
List the installed images:
[Trusty@~/code/octo/heroku/Tomcat]$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
archlinux latest a063a516f4c7 About an hour ago 293 MB
busybox latest e72ac664f4f0 13 days ago 2.433 MB
base/archlinux 2014.07.03 ea234cde99e6 12 weeks ago 282.9 MB
base/archlinux 2014.04.01 56c61f5c2920 12 weeks ago 293.3 MB
base/archlinux latest dce0559daa1b 12 weeks ago 282.9 MB
List Containers:
[Trusty@~/code/octo/heroku/Tomcat]$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
50baf5783c6e busybox:latest "/bin/echo hello wor 6 minutes ago Exited (0) 6 minutes ago mad_carson
2f7108d2ee0e archlinux:latest "echo Success." About an hour ago Exited (0) About an hour ago jolly_galileo
List the running Containers:
[Trusty@~/code/octo/heroku/Tomcat]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Now start a container via(This command will run into the container and execute the /bin/bash):
$ docker run -i -t archlinux /bin/bash
[root@b6ab14b2ce65 /]#
Check the container status:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b6ab14b2ce65 archlinux:latest "/bin/bash" 27 seconds ago Up 25 seconds high_wright
When you exit, then the ps won’t display the corresponding items.
Install More Images
Install via:
$ docker run ubuntu /bin/echo hello world
$ docker run centos /bin/echo hello world
Run it ubuntu:
$ docker run -i -t ubuntu /bin/bash
root@34b68719493b:/# cat /etc/issue
Ubuntu 14.04.1 LTS \n \l
Run into centos:
$ docker run -i -t centos /bin/bash
bash-4.2# uname -a
Linux e3ec1911331b 3.16.4-1-ARCH #1 SMP PREEMPT Mon Oct 6 08:22:27 CEST 2014 x86_64 x86_64 x86_64 GNU/Linux
bash-4.2# cat /etc/issue
\S
Kernel \r on an \m
bash-4.2# which yum
/usr/bin/yum
Oct 14, 2014
TechnologyBackground
Since building is heavy task to CPU, I decide to use the server in lab for building
Packages
We need to install following packages for setting up the building environment:
zypper in git patch u-boot-tools git ncurses-devel dpkg dpkg-devel dpkg-lang
Use git for acrossing the firewall of company:
> git config --global user.email xxxx@gmail.com
> git config --global user.name xxxx
> cat ~/.gitconfig
[user]
email = xxxx@gmail.com
name = xxx
Then we compile a cross Firewall tool and tell git for using it.
$ gcc -o connect connect.c
$ sudo cp connect /usr/bin
$ sudo chmod 777 /usr/bin/connect
$ sudo chmod 777 /usr/bin/myproxy
$ cat /usr/bin/myproxy
/usr/bin/connect -H 127.0.0.1:9001 $@
Now add the following lines in ~/.gitconfig:
[core]
gitproxy = /usr/bin/myproxy
Testing the git via:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git
Building
Be sure the directory had the same as in laptop. that is:
> pwd
/media/y/embedded/BBB/Kernel/bb-kernel
For long-time building, I install tmux for handling the process:
zypper in tmux
Under the folder, run build_kernel.sh
then you could get the Linux Kernel.
fakeroot should be installed in openSUSE:
http://software.opensuse.org/package/fakeroot?search_term=fakeroot
rpm -ivh fakeroot-1.20-1.18.x86_64.rpm
You should change the following files to enable the hostname:
Linux59:~ # cat /etc/hostname
Linux59
Linux59:~ # cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.0.1 Linux59.localdomain Linux59
Now run hostname via:
Linux59:~ # hostname --fqdn
Linux59.localdomain
Now run ./build_deb.sh
you could get the deb file.
Building Angstrom
First you should check out the git source from github:
git clone git://github.com/Angstrom-distribution/setup-scripts.git
Then run:
$ MACHINE=beagleboard ./oebb.sh config beagleboard
Trouble-Shooting
First I met tmux issue. so I installed the tmux in router(OpenWRT):
opkg update
opkg install tmux
Then I use tmux in router,create the new session which holds the ssh connection to the Server.
Then in family computer, the git proxy configuraiton won’t reset even if I update the ~/.gitconfig. This problem didn’t solved. I don’t know why.
Oct 14, 2014
TechnologyThe detailed installation guideline could be found at:
http://archlinuxarm.org/platforms/armv7/ti/beaglebone-black
But while there are some tips in changing the uEnv.txt, to enable the boot from 2nd mmc partition. following is the configuration file:
[root@alarm mnt]# cat uEnv.txt
optargs=coherent_pool=1M
#u-boot eMMC specific overrides; Angstrom Distribution (BeagleBone Black) 2013-06-20
kernel_file=zImage
initrd_file=uInitrd
loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file}
loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x81000000 ${initrd_file}; setenv initrd_size ${filesize}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /dtbs/${fdtfile}
#
console=ttyO0,115200n8
# If you want to boot from usb
#mmcroot=/dev/sda1 ro
# If you want to boot from SD card
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
Now reboot and then you could see the BBB runs into the ArchLinux.
Oct 14, 2014
TechnologyGeneral Method
When you were denied by github, use following method for get through:
Generate the key-gen
ssh-keygen
Then Creat the following files:
# cat /home/Trusty/.ssh/config
Host github.com
User xxx@xxx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
Now use following command for setting the connection:
ssh -T git@github.com
Under firewall
First add the ~/.ssh/id_rsa.pub to the github’s “SSH keys”.
If your machine runs under the firewall, you have to do things like following:
ssh -L 2121:github.com:22 root@1xxx.xxx.xxx.158
Then in another terminal, run:
ssh -T git@localhost -p 2121
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
Oct 13, 2014
TechnologyBackground
I have BeagleBone Black and RaspberryPi, both of them are cute board. Previous I use BBB for home server, which holds my own Weather APP website, also serves as a sshd server, dynamic dns server, etc. While Rpi serves like a File server and download server.
Now I want to use BBB for developing some funny things, that means I will transfer all of the functionalities which runs in BBB to Rpi. Following steps will record what I have done.
Before start, update all of the software in Rpi(it runs archLinux):
$ sudo pacman -Syu --noconfirm
sshd
Previously the sshd on BeagleBone listens on port 3333, now I have to change it back to 22,
/[root@alarmpi ~]# cat /etc/ssh/sshd_config
#Port 3333
Port 22
Restart the service via systemctl restart sshd
, then you could directly ssh to 10.0.0.230
.
DDns
Previous the BBB acts as the Ddns client, thus hold a no-ip.biz based domain name.
On BBB, because it runs the Debian7.1, so the no-ip2 configuraiton is :
root@arm:/etc# ps -ef | grep noip | grep -v grep
nobody 3184 1 0 Oct07 ? 00:00:01 /usr/local/bin/noip2 -c /usr/local/etc/no-ip2.conf
While the configuration file is located at:
root@arm:/etc# cat /etc/rc.local
# By default this script does nothing.
# But we will call noip in this scirpt
/usr/local/bin/noip2 -c /usr/local/etc/no-ip2.conf &
So first we should comment this line. Then activate the Rpi’s no-ip2.
The Rpi’s configuraiton is using systemd.
The corresponding configuration file is located at:
[root@alarmpi system]# pwd
/usr/lib/systemd/system
[root@alarmpi system]# cat noip2.service
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/noip2 -c /etc/no-ip2.conf
[Install]
WantedBy=multi-user.target
Simply disable it via:
$ sudo systemctl disable noip2.service
ssh with nopasswd
Make sure all of the configuration is the same in .ssh/authorized_keys
Then you could change the port in router, change the default 22 port from BBB to Rpi.
Reboot the router, and BBB & Rpi.