Newer
Older
This is a pure-Python module with no external dependencies for accessing libc
functions and macros needed for dealing with Linux namespaces. The point is to
be easily installed without needing anything more than Python and Pip.
API
---
This module exposes some of the libc calls that are needed for dealing with
namespaces and thus containers in Linux. These are plain calls to the libc
functions and their behaviour is the same. The functions are:
- `unshare <http://man7.org/linux/man-pages/man2/unshare.2.html>`_
- `unmount <http://man7.org/linux/man-pages/man2/unmount.2.html>`_
- `unmount2 <http://man7.org/linux/man-pages/man2/unmount2.2.html>`_
- `mount <http://man7.org/linux/man-pages/man2/mount.2.html>`_
- `pivot_root <http://man7.org/linux/man-pages/man2/pivot_root.2.html>`_
- `setns <http://man7.org/linux/man-pages/man2/setns.2.html>`_
- `sethostname <http://man7.org/linux/man-pages/man2/sethostname.2.html>`_
- `clone <http://man7.org/linux/man-pages/man2/clone.2.html>`_
- Tox (install from PyPI by running (:code:`pip install tox`).
- libc headers, make and GCC (On Debian/Ubuntu install by running :code:`apt
install linux-libc-dev build-essential`).
Testing is done by running :code:`tox`. Auto-generated code (for now just
:code:`unshare/constants.py`) is generated by running :code:`make all`. For Mac
developers there's a Vagrant box defined (it optionally uses
`vagrant-gatling-rsync <https://github.com/smerrill/vagrant-gatling-rsync>`_).
Finally, releasing a version is done by running :code:`tox -e release`.
License
-------
This software is licnesed under the MIT licese (see the :code:`LICENSE.txt`
file).
Author
------
Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website
<https://www.shore.co.il/>`_. Patches are welcome via `git send-email
<http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located
at: https://www.shore.co.il/git/.
- Replace the GCC preprocessor for generating :code:`unshare/constants.py`
with a Python one (`CPIP <http://cpip.sourceforge.net/>`_ or `pycparser
<https://github.com/eliben/pycparser>`_).