go>> serf>> 返回
项目作者: overneath

项目描述 :
hashicorp/serf `FROM scratch`
高级语言: Dockerfile
项目地址: git://github.com/overneath/serf.git
创建时间: 2019-01-18T06:36:17Z
项目社区:https://github.com/overneath/serf

开源协议:

下载


Nothin’ but Serf

Hashicorp Serf

But Why Though

I needed a minimal installation of hashicorp/serf, downloaded and verified from the official Serf downloads page. This serves as a simple, containerized installation source.

Docker

To install into an image via Dockerfile:

  1. COPY --from=overneath/serf:0.8 /opt/local/ /usr/local/

LinuxKit

To underlay in minimalist LinuxKit composition:

  1. kernel:
  2. # ...
  3. init:
  4. - linuxkit/init:v0.6
  5. # ...
  6. - overneath/serf:0.8
  7. onboot:
  8. # ...
  9. services:
  10. # ...
  11. - name: serf
  12. image: alpine:3.7
  13. binds:
  14. - /etc/resolv.conf:/etc/resolv.conf
  15. - /run/config/serf:/etc/serf
  16. - /opt/local:/usr/local
  17. - /var/lib/serf:/var/lib/serf
  18. command: [/usr/local/bin/serf, agent, -config-dir=/etc/serf, -tags-file=/var/lib/serf/tags.json]
  19. runtime:
  20. mkdir:
  21. - /run/config/serf
  22. - /var/lib/serf

To verify that the LinuxKit build is working, invoke via linuxkit run and then after the OS comes up in the getty console:

  1. nsenter -a -t 1 /opt/local/bin/serf members

E.g. (in the linuxkit run console):

  1. (ns: getty) linuxkit-025000000006:~# nsenter -a -t 1 /opt/local/bin/serf members
  2. linuxkit-025000000006 127.0.0.1:7946 alive
  3. (ns: getty) linuxkit-025000000006:~#
  4. (ns: getty) linuxkit-025000000006:~# poweroff
  5. The system is going down NOW!0006:~# ^[[20;38R
  6. Sent SIGTERM to all processes
  7. Sent SIGKILL to all processes
  8. Requesting system poweroff
  9. [ 17.369562] ACPI: Preparing to enter system sleep state S5
  10. [ 17.371389] reboot: Power down