2. 安装

    或永久开启

    下载cocker源码包,解开,进入

    1. # tar xvzf cocker-X.X.X.tar.gz
    2. # cd cocker-X.X.X

    or

    1. # git clone https://github.com/calvinwilliams/cocker
    2. # cd cocker

    注意:如果你在非root用户编译源码,确认sudo无需输入密码。

    编译并安装到系统目录里

    注意:如果你在非root用户编译源码,前面加上sudo -E

    1. # make -f makefile.Linux install
    2. make[1]: 进入目录“/home/calvin/src/cocker/src
    3. make[2]: 进入目录“/home/calvin/src/cocker/src/util
    4. rm -f list.o
    5. rm -f LOGC.o
    6. rm -f version.o
    7. rm -f file.o
    8. rm -f string.o
    9. rm -f socket.o
    10. rm -f pts.o
    11. rm -f libcocker_util.so
    12. make[2]: 离开目录“/home/calvin/src/cocker/src/util
    13. make[2]: 进入目录“/home/calvin/src/cocker/src/cocker
    14. rm -f util.o
    15. rm -f main.o
    16. rm -f env.o
    17. rm -f show_images.o
    18. rm -f show_containers.o
    19. rm -f action_create.o
    20. rm -f action_destroy.o
    21. rm -f action_boot.o
    22. rm -f action_shutdown.o
    23. rm -f action_version.o
    24. rm -f action_vip.o
    25. rm -f action_port_mapping.o
    26. rm -f action_volume.o
    27. rm -f action_attach.o
    28. rm -f action_install_test.o
    29. rm -f action_to_container.o
    30. rm -f action_to_image.o
    31. rm -f action_copy_image.o
    32. rm -f action_del_image.o
    33. rm -f action_export.o
    34. rm -f action_import.o
    35. rm -f action_spush.o
    36. rm -f action_spull.o
    37. rm -f cocker
    38. make[2]: 进入目录“/home/calvin/src/cocker/src/cockerinit
    39. rm -f main.o
    40. rm -f server.o
    41. rm -f pty.o
    42. rm -f pts_and_tcp_bridge.o
    43. rm -f cockerinit
    44. make[2]: 离开目录“/home/calvin/src/cocker/src/cockerinit
    45. make[1]: 离开目录“/home/calvin/src/cocker/src
    46. make[1]: 进入目录“/home/calvin/src/cocker/shbin
    47. make[1]: 离开目录“/home/calvin/src/cocker/shbin
    48. make[1]: 进入目录“/home/calvin/src/cocker/src
    49. make[2]: 进入目录“/home/calvin/src/cocker/src/util
    50. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c list.c
    51. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c LOGC.c
    52. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c version.c
    53. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c file.c
    54. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c string.c
    55. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c socket.c
    56. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -c pts.c
    57. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -o libcocker_util.so list.o LOGC.o version.o file.o string.o socket.o pts.o -shared -L. -L/lib64 -L/usr/lib64 -L/usr/lib
    58. rm -f /lib64/libcocker_util.so
    59. cp -rf libcocker_util.so /lib64/
    60. rm -f /usr/include/cocker_in/list.h
    61. cp -rf list.h /usr/include/cocker_in/
    62. rm -f /usr/include/cocker_in/LOGC.h
    63. cp -rf LOGC.h /usr/include/cocker_in/
    64. rm -f /usr/include/cocker_in/cocker_util.h
    65. cp -rf cocker_util.h /usr/include/cocker_in/
    66. make[2]: 离开目录“/home/calvin/src/cocker/src/util
    67. make[2]: 进入目录“/home/calvin/src/cocker/src/cocker
    68. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c util.c
    69. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c main.c
    70. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c env.c
    71. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c show_images.c
    72. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c show_containers.c
    73. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_create.c
    74. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_destroy.c
    75. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_boot.c
    76. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_shutdown.c
    77. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_version.c
    78. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_port_mapping.c
    79. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_volume.c
    80. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_attach.c
    81. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_to_container.c
    82. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_to_image.c
    83. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_copy_image.c
    84. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_del_image.c
    85. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_export.c
    86. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_import.c
    87. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c show_ssearch.c
    88. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_spush.c
    89. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c action_spull.c
    90. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -o cocker util.o main.o env.o show_images.o show_containers.o action_create.o action_destroy.o action_boot.o action_shutdown.o action_version.o action_vip.o action_port_mapping.o action_volume.o action_attach.o action_install_test.o action_to_container.o action_to_image.o action_copy_image.o action_del_image.o action_export.o action_import.o show_ssearch.o action_spush.o action_spull.o -L. -L/lib64 -L/usr/lib64 -L/usr/lib -L/lib64 -lcocker_util -lcrypto
    91. rm -f /bin/cocker
    92. cp -rf cocker /bin/
    93. make[2]: 离开目录“/home/calvin/src/cocker/src/cocker
    94. make[2]: 进入目录“/home/calvin/src/cocker/src/cockerinit
    95. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c main.c
    96. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c server.c
    97. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c pty.c
    98. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -I. -I/usr/include -I/usr/include -std=gnu99 -I/usr/include/cocker_in -c pts_and_tcp_bridge.c
    99. gcc -g -fPIC -O2 -Wall -Werror -fno-strict-aliasing -o cockerinit main.o server.o pty.o pts_and_tcp_bridge.o -L. -L/lib64 -L/usr/lib64 -L/usr/lib -L/lib64 -lcocker_util -lcrypto
    100. rm -f /bin/cockerinit
    101. cp -rf cockerinit /bin/
    102. make[2]: 离开目录“/home/calvin/src/cocker/src/cockerinit
    103. make[1]: 离开目录“/home/calvin/src/cocker/src
    104. make[1]: 进入目录“/home/calvin/src/cocker/shbin
    105. rm -f /bin/cocker_ldd_and_cp_lib64.sh
    106. cp -rf cocker_ldd_and_cp_lib64.sh /bin/
    107. rm -f /bin/cocker_profile_template.sh
    108. cp -rf cocker_profile_template.sh /bin/
    109. rm -f /bin/cocker_etc_profile_template.sh
    110. cp -rf cocker_etc_profile_template.sh /bin/
    111. rm -f /bin/cocker_install_test.sh
    112. cp -rf cocker_install_test.sh /bin/
    113. rm -f /bin/cocker_create_image_rhel-7.4-x86_64.sh
    114. cp -rf cocker_create_image_rhel-7.4-x86_64.sh /bin/
    115. rm -f /bin/cocker_create_image_rhel-7.4-gcc-x86_64.sh
    116. cp -rf cocker_create_image_rhel-7.4-gcc-x86_64.sh /bin/
    117. make[1]: 离开目录“/home/calvin/src/cocker/shbin
    • 构建出开发内部使用头文件src/cocker/*.h安装到/usr/include/cocker_in,库文件libcocker_util.so安装到/lib64。开发内部文件仅用于编译。
    • 构建出可执行文件cockercockerinit安装到/bin
    • 自带脚本安装到/bin