This is a creation in Article, where the information may have evolved or changed.
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53638227 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys
1,golang is ideal for cloud computing
Docker is very good, Golang can also run directly on the Alpine system
However, Golang is a compiled language, not like Java. The jar can be copied to other systems, and Golang depends on the compilation environment.
One of the mistakes made before is to put the binaries on the CentOS system compiled.
Copied to the Alpine system, the results of the execution error.
Golang is compiled or dependent on different operating systems.
So simply use VirtualBox to create a Alpine virtual machine.
The operation on the Alpine is much more convenient.
2, install Alpine
Download the ISO file.
Http://alpinelinux.org/downloads
Installation:
Https://wiki.alpinelinux.org/wiki/Installation
Create a virtual machine without saying it.
After the iOS image file is mounted on the Alpine.
Start to enter the login screen. User name root, password is empty. (The default)
Executing the installation statement
setup-alpine
This installation without the CentOS interface, is a shell script. Step-by-step execution is fine.
Https://wiki.alpinelinux.org/wiki/Alpine_setup_scripts
First, you need to enter the keyboard format.
The IP is then automatically obtained.
Set the Administrator password
Enter the time zone Asia/shanghai direct input is OK.
Next, format the hard drive
The first LVM is selected, and then a SYS is selected.
Only SYS is the file written to the hard disk.
Finally erase the hard drive. Using a virtual machine is not a problem, pay attention to the data backup when the real machine.
Generally speaking, installation scripts do not have much problem.
There are times when you may not be able to access the network. Reboot the virtual machine at this time and restart.
Https://wiki.alpinelinux.org/wiki/Configure_Networking
or configure the network yourself.
Vi/etc/resolv.conf
NameServer 114.114.114.114
Restart Network
/etc/init.d/networking restart
Ifconfig look at the IP
It is better to change the address of the mirror to Tsinghua.
echo"https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main" > /etc/apk/repositoriesapk update
You can also edit/etc/apk/repositories directly
The installation is complete and prompts to restart.
3, enter the system
After entering the system
Disk space takes up a very small amount.
Such a alpine Linux system is installed.
4. Open SSH Remote Login
The default alpine does not have Telnet permissions turned on.
SSH remote login is not.
Vi/etc/ssh/sshd_config
Increase:
Permitrootlogin Yes
Allow root login, of course this is the test environment, the future convenient.
5, summary
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53638227 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys
Alpine Linux system is very small. In the future, the simulation test can be done on this.
This environment compiles the Golang binary files later. You can copy it to the Alpine of Docker.
Some features can also be tested on this environment.