IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

README.md 4.0KB

il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. # Focker
  2. ## Introduction
  3. Focker is a FreeBSD image orchestration tool in the vein of Docker.
  4. ## Installation
  5. In order to use Focker you need a ZFS pool available in your FreeBSD installation.
  6. ### Installing the Python package
  7. Run:
  8. ```bash
  9. git clone https://github.com/sadaszewski/focker.git
  10. cd focker/
  11. python setup.py install
  12. ```
  13. or (if you want an uninstaller):
  14. ```bash
  15. git clone https://github.com/sadaszewski/focker.git
  16. cd focker/
  17. python setup.py sdist
  18. pip install dist/focker-0.9.tgz
  19. ```
  20. ### Setting up ZFS
  21. Upon first execution of the `focker` command, Focker will automatically create the necessary directories and ZFS datasets. You just need to exclude the unlikely case that you are already using /focker in your filesystem hierarchy. The layout after initialization will look the following:
  22. ```
  23. /focker
  24. /focker/images
  25. /focker/jails
  26. /focker/volumes
  27. ```
  28. `images`, `jails`, and `volumes` have corresponding ZFS datasets with `canmount=off` so that they serve as mountpoint anchors for child entries.
  29. ### Preparing base image
  30. To bootstrap the images system you need to install FreeBSD in jail mode to a ZFS dataset placed in /focker/images and provide two user-defined properties - `focker:sha256` and `focker:tags`. One way to achieve this would be the following:
  31. ```bash
  32. TAGS="freebsd-latest freebsd-$(freebsd-version | cut -d'-' -f1)"
  33. VERSION="FreeBSD $(freebsd-version)"
  34. SHA256=$(echo -n ${VERSION} | sha256)
  35. NAME=${SHA256:0:7}
  36. zfs create -o focker:sha256=${SHA256} -o focker:tags="${TAGS}" zroot/focker/images/${NAME}
  37. bsdinstall jail /focker/images/${NAME}
  38. zfs set readonly=on zroot/focker/images/${NAME}
  39. zfs snapshot zroot/focker/images/${NAME}@1
  40. ```
  41. ## Usage
  42. At this point, Focker is ready to use.
  43. ### `focker` command syntax
  44. The `focker` command is the single entrypoint to all of the Focker's functionality. The overview of its syntax is presented below as a tree where the `focker` command is the root, the first level of descendants represents the choice of Level 1 mode (`image`, `jail`, `volume` or `compose`), the second level - the Level 2 mode (dependent on L1 mode) and the final third level lists required and optional arguments specific to the given combination of L1/L2 modes.
  45. ```
  46. focker
  47. |- image|img|im|i
  48. | |- build|b
  49. | | |- FOCKER_DIR
  50. | | `- --tags|-t TAG [...TAG]
  51. | |- tag|t
  52. | | |- REFERENCE
  53. | | `- TAG [...TAG]
  54. | |- untag|u
  55. | | `- TAG [...TAG]
  56. | |- list|ls|l
  57. | | `- --full-sha256|-f
  58. | |- prune|p
  59. | `- remove|r
  60. | |- REFERENCE
  61. | `- --remove-dependents|-R
  62. |- jail|j
  63. | |- create|c
  64. | | |- IMAGE
  65. | | |- --command|-c COMMAND (default: /bin/sh)
  66. | | |- --env|-e VAR1:VALUE1 [...VARN:VALUEN]
  67. | | |- --mounts|-m FROM1:ON1 [...FROMN:ONN]
  68. | | `- --hostname|-n HOSTNAME
  69. | |- start|s
  70. | | `- REFERENCE
  71. | |- stop|S
  72. | | `- REFERENCE
  73. | |- remove|r
  74. | | `- REFERENCE
  75. | |- exec|e
  76. | | |- REFERENCE
  77. | | `- [...COMMAND]
  78. | |- oneshot|o
  79. | | `- IMAGE
  80. | | `- --env|-e VAR1:VALUE1 [...VARN:VALUEN]
  81. | | `- --mounts|-m FROM1:ON1 [...FROMN:ONN]
  82. | | `- [...COMMAND]
  83. | |- list|ls|l
  84. | | `- --full-sha256|-f
  85. | |- tag|t
  86. | | |- REFERENCE
  87. | | `- TAG [...TAG]
  88. | |- untag|u
  89. | | `- TAG [...TAG]
  90. | `- prune|p
  91. | `- --force|-f
  92. |- volume
  93. | |- create
  94. | | `- --tags|-t TAG [...TAG]
  95. | |- prune
  96. | |- list
  97. | | `- --full-sha256|-f
  98. | |- tag
  99. | | |- REFERENCE
  100. | | `- TAG [...TAG]
  101. | `- untag
  102. | `- TAG [...TAG]
  103. `- compose
  104. |- build
  105. | `- FILENAME
  106. `- run
  107. |- FILENAME
  108. `- COMMAND
  109. ```
  110. Individual combinations are briefly described below:
  111. #### focker image
  112. ##### build
  113. ##### tag
  114. ##### untag
  115. ##### list
  116. ##### prune
  117. ##### remove
  118. #### focker jail
  119. ##### create
  120. ##### start
  121. ##### stop
  122. ##### remove
  123. ##### exec
  124. ##### oneshot
  125. ##### list
  126. ##### tag
  127. ##### untag
  128. ##### prune
  129. #### focker volume
  130. ##### create
  131. ##### prune
  132. ##### list
  133. ##### tag
  134. ##### untag
  135. #### focker compose
  136. ##### build
  137. ##### run