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!
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

README.md 2.3KB

4 yıl önce
4 yıl önce
4 yıl önce
4 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. ```
  45. focker
  46. |- image
  47. | |- build
  48. | | |- focker_dir
  49. | | `- --tags|-t TAG [...]
  50. | |- tag
  51. | | |- reference
  52. | | `- TAG [...]
  53. | |- untag
  54. | | `- TAG [...]
  55. | |- list
  56. | | `- --full-sha256|-f
  57. | |- prune
  58. | `- remove
  59. | | |- reference
  60. | | `- --remove-dependents|-R
  61. |- jail
  62. | |- create
  63. | |- start
  64. | |- stop
  65. | |- remove
  66. | |- exec
  67. | |- oneshot
  68. | |- list
  69. | |- tag
  70. | |- untag
  71. | `- prune
  72. |- volume
  73. | |- create
  74. | |- prune
  75. | |- list
  76. | |- tag
  77. | `- untag
  78. `- compose
  79. |- build
  80. `- run
  81. ```