Centos7 install golang
Install golangcentos7 and install golang [plain] view plaincopy directly
- Yuminstallgolang
For centos6, you must add a software source and then install [plain] view plaincopy.
- Rpm-ivhhttp: // ftp.riken.jp/linux/fedora/epel/6/ I #/epel-release-6-8.noarch.rpm
- Yuminstallgolang
Install the dependency package [plain] view plaincopy
- Yumgroupinstall 'developmenttool'
- Yuminstallglibc-static sqlite-devel.x86_64libselinux-staticlibsepol-static
- Yuminstalllibuuid-devellibattr-develzlib-devellibacl-devele2fsprogs-devellibblkid-devellzo-develasciidocxmlto
Compile device mapper [plain] view plaincopy
- Gitclone -- no-checkouthttps: // example
- # If the download times out, use Upload
- Cd/usr/local/lvm2 &./configure -- enable-static_link & make & makeinstall
Do not use it here. /configure -- enable-static_link & make device-mapper & make install_device-mapper only compile device mapper, this may be because the lvm and device mapper do not match, resulting in lvm failure to run, when the physical machine is restarted next time, all lvm file systems are unavailable and the operating system can only be reinstalled.
Compile and install sqlite [plain] view plaincopy
- Wgethttp: // www.sqlite.org/2015/sqlite-autoconf-3080803.tar.gz
- ./Configure
- Make
- Makeinstall
Install btrfs-progscentos7 [plain] view plaincopy
- Yuminstallbtrfs-progs
Centos6 [plain] view plaincopy
- Gitclonegit: // git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
- Cdbtrfs-progs
- ./Autogen. sh
- ./Configure
- Make
- Makeinstall
Set the environment variable [plain] view plaincopy
- ExportGOPATH =/path/to/go # Put the docker directory in/path/to/go/docker
- ExportAUTO_GOPATH = 1
Compile docker
Static compilation [plain] view plaincopy
- ./Hack/make. shbinary
Dynamic compilation of docker [plain] view plaincopy
- ./Hack/make. shdynbinary
TroubleShooting
- An error occurred while executing lvm -- version:
Lvm: relocation error: lvm: symbol dm_get_status_cache, version Base not defined in file libdevmapper. so.1.02 with link time reference this is because device mapper is updated and lvm is not updated. Run [plain] view plaincopy directly.
- Cd/usr/local/lvm2 &./configure -- enable-udev_sync & make & makeinstall
- The following warning is reported when docker is started:
Level = "warning" msg = "WARNING: Udev sync is not supported. this will lead to unexpected behavior, data loss and errors "is because no udev sync support is added during device mapper compilation. Run the following command to re-compile: [plain] view plaincopy
- Yuminstalllibudev-devel
- Cd/usr/local/lvm2 &./configure -- enable-udev_sync & make & makeinstall
- Cddocker &./hack/make. shdynbinary
Currently, udev does not have a static library available. Therefore, you can only compile the dynamic link library of device mapper, and you can only compile docker of Dynamic Link version.
- An error occurred while compiling device er in centos7. The error message is as follows: unsolved. Help?
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (seusers. o): In function 'getseuserbyname ':
(. Text + 0x334): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (seusers. o): In function 'getseuserbyname ':
(. Text + 0x306): warning: Using 'getgrnam _ R' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (seusers. o): In function 'getseuserbyname ':
(. Text + 0x570): warning: Using 'getpwnam _ R' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (load_policy.o): In function 'selinux _ mkload_policy ':
(. Text + 0x302): undefined reference to 'lzma _ stream_decoder'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (load_policy.o): In function 'selinux _ mkload_policy ':
(. Text + 0x411): undefined reference to 'lzma _ Code'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (load_policy.o): In function 'selinux _ mkload_policy ':
(. Text + 0x482): undefined reference to 'lzma _ end'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (load_policy.o): In function 'selinux _ mkload_policy ':
(. Text + 0x642): undefined reference to 'lzma _ end'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (label_file.o): In function 'closef ':
(. Text + 0x136): undefined reference to 'pcre _ free'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (label_file.o): In function 'closef ':
(. Text + 0x13f): undefined reference to 'pcre _ free_study'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3 /.. /.. /.. /.. /lib64/libselinux. a (label_file.o): In function 'compile _ regex. isra.5 ':
(. Text + 0x270): undefined reference to 'pcre _ compile'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3 /.. /.. /.. /.. /lib64/libselinux. a (label_file.o): In function 'compile _ regex. isra.5 ':
(. Text + 0x291): undefined reference to 'pcre _ study'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (label_file.o): In function 'lookup ':
(. Text + 0x4fa): undefined reference to 'pcre _ exec'
/Usr/lib/gcc/x86_64-redhat-linux/4.8.3/.../lib64/libselinux. a (label_file.o): In function 'lookup ':
(. Text + 0x572): undefined reference to 'pcre _ exec'
Collect2: error: ld returned 1 exit status
Make [1]: *** [dmsetup. static] Error 1
Make [1]: Leaving directory '/root/lvm2-2_02_103/tools'
Make: *** [tools. device-mapper] Error 2
- An error occurred while starting the static compiling docker (the dynamic compiling version runs normally). The information is as follows. The problem is not solved. Ask for help.
#/Root/go/docker/bundles/1.4.1-dev/binary/docker-1.4.1-dev-H unix: // var/run/docker. sock-H tcp: // 0.0.0.0: 5050-d-g/home/docker/-- bridge = "" -- group = ""
INFO [0000] + job serveapi (unix: // var/run/docker. sock, tcp: // 0.0.0.0: 5050)
INFO [0000] WARNING: You are running linux kernel version 2.6.32-431. el6.x86 _ 64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
WARN [0000] WARNING: Udev sync is not supported. This will lead to unexpected behavior, data loss and errors
INFO [0000] Listening for HTTP on unix (/var/run/docker. sock)
INFO [0000] Listening for HTTP on tcp (0.0.0.0: 5050)
INFO [0000]/! \ DON't bind on another ip address than 127.0.0.1 if you don't know what you're DOING /! \
Fatal error: unexpected signal during runtime execution
[Signal 0xb code = 0x1 addr = 0x0 pc = 0x0]
Runtime stack:
Runtime: unexpected return pc for runtime. sigpanic called from 0x988759
Runtime. throw (0x12bdce5)
/Usr/lib/golang/src/pkg/runtime/panic. c: 520 + 0x69
Runtime: unexpected return pc for runtime. sigpanic called from 0x988759
Runtime. sigpanic ()
/Usr/lib/golang/src/pkg/runtime/OS _linux.c: 222 + 0x3d
Goroutine 24 [syscall]:
Runtime. cgocall (0x402028, 0xc208399038)
/Usr/lib/golang/src/pkg/runtime/cgocall. c: 143 + 0xe5 fp = 0xc208399020 sp = 0xc208398fd8
Github.com/docker/docker/pkg/devicemapper._Cfunc_dm_udev_wait (0x0, 0xc2085970c0)
Github.com/docker/docker/pkg/devicemapper/_obj/_cgo_defun.c:257 + 0x31 fp = 0xc208399038 sp = 0xc208399020
Github.com/docker/docker/pkg/devicemapper.dmUdevWaitFct (0x0, 0xc208399080)
/Root/go/docker/pkg/devicemapper/devmapper_wrapper.go: 247 + 0x28 fp = 0xc208399058 sp = 0xc208399038
Github.com/docker/docker/pkg/devicemapper.UdevWait (0x0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/pkg/devicemapper/devmapper.go:287 + 0x44 fp = 0xc2083990c8 sp = 0xc208399058
Github.com/docker/docker/pkg/devicemapper.ActivateDevice (0xc208587b90, 0x25, 0xc2083508c0, 0x19, 0x1, 0x280000000, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/pkg/devicemapper/devmapper.go:641 + 0x6a9 fp = 0xc208399210 sp = 0xc2083990c8
Github.com/docker/docker/daemon/graphdriver/devmapper. (* DeviceSet). activateDeviceIfNeeded (0xc208041680, 0xc2080040c0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/daemon/graphdriver/devmapper/deviceset.go:429 + 0x1d3 fp = 0xc2083992a8 sp = 0xc208399210
Github.com/docker/docker/daemon/graphdriver/devmapper. (* DeviceSet). setupBaseImage (0xc208041680, 0x0, 0x0)
/Root/go/docker/. gopath/src/export + 0x472 fp = 0xc208399378 sp = 0xc2083992a8
Github.com/docker/docker/daemon/graphdriver/devmapper. (* DeviceSet). initDevmapper (0xc208041680, 0x200001, 0x0, 0x0)
/Root/go/docker/. gopath/src/export + 0x1202 fp = 0xc2083995e8 sp = 0xc208399378
Round (0xc2080817e0, 0x19, 0xc20000ef01, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0)
/Root/go/docker/. gopath/src/clusters + 0x457 fp = 0xc2083997c0 sp = 0xc2083995e8
Github.com/docker/docker/daemon/graphdriver/devmapper.Init (0xc2080817e0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/daemon/graphdriver/devmapper/driver.go:43 + 0x16e fp = 0xc208399890 sp = 0xc2083997c0
Round (0xcd1010, 0xc, 0xc20808e6e0, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ,...)
/Root/go/docker/. gopath/src/github.com/docker/docker/daemon/graphdriver/driver.go:136 + 0x187 fp = 0xc208399940 sp = 0xc208399890
Values (0xc20808e6e0, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ff36b7071b0, 0xc2080019c0)
/Root/go/docker/. gopath/src/github.com/docker/docker/daemon/graphdriver/driver.go:150 + 0x2ac fp = 0xc208399a98 sp = 0xc208399940
Github.com/docker/docker/daemon.NewDaemonFromDirectory (0x12dfc40, 0xc2080b7340, 0x0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/daemon/daemon.go:861 + 0x8b2 fp = 0xc208399e18 sp = 0xc208399a98
Github.com/docker/docker/daemon.NewDaemon (0x12dfc40, 0xc2080b7340, 0x0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/daemon/daemon.go:781 + 0x43 fp = 0xc208399e58 sp = 0xc208399e18
Main. func · 002 ()
/Root/go/docker/daemon. go: 104 + 0x46 fp = 0xc208399fa8 sp = 0xc208399e58
Runtime. goexit ()
/Usr/lib/golang/src/pkg/runtime/proc. c: 1445 fp = 0xc208399fb0 sp = 0xc208399fa8
Created by main. mainDaemon
/Root/go/docker/daemon. go: 127 + 0x336
Goroutine 16 [chan receive]:
Github.com/docker/docker/api/server.ServeApi (0xc20804cb00, 0x7ff36b70c3a8)
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:1653 + 0x473
Github.com/docker/docker/engine. (* Job). Run (0xc20804cb00, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/engine/job.go:83 + 0x837
Main. mainDaemon ()
/Root/go/docker/daemon. go: 142 + 0x5ba
Main. main ()
/Root/go/docker. go: 73 + 0x424
Goroutine 19 [finalizer wait]:
Runtime. park (0x41a4b0, 0x12dc658, 0x12c3529)
/Usr/lib/golang/src/pkg/runtime/proc. c: 1369 + 0x89
Runtime. parkunlock (0x12dc658, 0x12c3529)
/Usr/lib/golang/src/pkg/runtime/proc. c: 1385 + 0x3b
Runfinq ()
/Usr/lib/golang/src/pkg/runtime/mgc0.c: 2644 + 0xcf
Runtime. goexit ()
/Usr/lib/golang/src/pkg/runtime/proc. c: 1445
Goroutine 20 [syscall]:
OS/signal. loop ()
/Usr/lib/golang/src/pkg/OS/signal/signal_unix.go: 21 + 0x1e
Created by OS/signal. init · 1
/Usr/lib/golang/src/pkg/OS/signal/signal_unix.go: 27 + 0x32
Goroutine 17 [syscall]:
Runtime. goexit ()
/Usr/lib/golang/src/pkg/runtime/proc. c: 1445
Goroutine 23 [chan receive]:
Github.com/docker/docker/pkg/signal.func-002 ()
/Root/go/docker/. gopath/src/github.com/docker/docker/pkg/signal/trap.go:30 + 0x88
Created by github.com/docker/docker/pkg/signal.Trap
/Root/go/docker/. gopath/src/github.com/docker/docker/pkg/signal/trap.go:53 + 0x28f
Goroutine 25 [chan receive]:
Github.com/docker/docker/pkg/listenbuffer. (* defaultListener). Accept (0xc20845c320, 0x0, 0x0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/pkg/listenbuffer/buffer.go:43 + 0xb3
Net/http. (* Server). Serve (0xc208438de0, 0x7ff36b712a28, 0xc20845c320, 0x0, 0x0)
/Usr/lib/golang/src/pkg/net/http/server. go: 1698 + 0x91
Github.com/docker/docker/api/server. (* HttpServer). Serve (0xc20845c4a0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:51 + 0x4c
Github.com/docker/docker/api/server.func-006 ()
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:1648 + 0x267
Created by github.com/docker/docker/api/server.ServeApi
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:1649 + 0x3fa
Goroutine 26 [chan receive]:
Github.com/docker/docker/pkg/listenbuffer. (* defaultListener). Accept (0xc208351bc0, 0x0, 0x0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/pkg/listenbuffer/buffer.go:43 + 0xb3
Net/http. (* Server). Serve (0xc2080056e0, 0x7ff36b712a28, 0xc208351bc0, 0x0, 0x0)
/Usr/lib/golang/src/pkg/net/http/server. go: 1698 + 0x91
Github.com/docker/docker/api/server. (* HttpServer). Serve (0xc208351fa0, 0x0, 0x0)
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:51 + 0x4c
Github.com/docker/docker/api/server.func-006 ()
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:1648 + 0x267
Created by github.com/docker/docker/api/server.ServeApi
/Root/go/docker/. gopath/src/github.com/docker/docker/api/server/server.go:1649 + 0x3fa references: http://www.tuicool.com/articles/6VBnQj