Jails dins PC BSD / FreeBSD
iocage
Iocage es un otís lo mai avançat per gerir las gabias dins l'environament BSD. Documentacion. Es un pauc coma Proxmox levat l'interfacia que serà lèu integrada dins PC BSD o TrueOS. Iocage s'apuèja bravament sus la tecnologia ZFS d'aquelas generacions de BSD. L'estocatge de las donadas se fa sur zfs e un fais de possibilitats son ofertas per far de snapshots (un sulpic), de clòns per mandar o duplicar las machinas virtualas. Per mandar un snapshot dins una autra machina lo metòd zfs send marcha plan.
Quala es la version del sistèm operatiu ?
[dc@bolido] ~% uname -a FreeBSD bolido 10.3-RELEASE-p5 FreeBSD 10.3-RELEASE-p5 #0: Thu Jun 30 03:52:15 UTC 2016 root@amd64-builder.pcbsd.org:/usr/obj/usr/src/sys/GENERIC amd64
Creacion del jail
[root@bolido] /# iocage create tag=gabia0 host=gabia0.macarel.net ip4_addr='em0|192.168.0.20' [root@bolido] /# iocage start gabia0 * Starting e077349d-37c5-11e7-b678-00241daad556 (gabia0) + Started (shared IP mode) OK + Starting services OK [root@bolido] /# iocage console gabia0 FreeBSD 10.3-RELEASE-p5 (GENERIC) #0: Thu Jun 30 03:52:15 UTC 2016 Welcome to FreeBSD! ... Edit /etc/motd to change this login announcement.
Primièra installacion
root@e077349d-37c5-11e7-b678-00241daad556:~ # pkg -r python3 The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done [e077349d-37c5-11e7-b678-00241daad556] Installing pkg-1.10.1... [e077349d-37c5-11e7-b678-00241daad556] Extracting pkg-1.10.1: 100% pkg: no commands specified Usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>|-r <rootdir>] [-C <configuration file>] [-R <repo config dir>] [-o var=value] [-4|-6] <command> [<args>] For more information on available commands and options see 'pkg help'.
Installacion de Python 3
root@e077349d-37c5-11e7-b678-00241daad556:~ # pkg install python3 Updating FreeBSD repository catalogue... pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory [e077349d-37c5-11e7-b678-00241daad556] Fetching meta.txz: 100% 944 B 0.9kB/s 00:01 [e077349d-37c5-11e7-b678-00241daad556] Fetching packagesite.txz: 100% 6 MiB 992.7kB/s 00:06 Processing entries: 100% FreeBSD repository update completed. 26278 packages processed. All repositories are up to date. Updating database digests format: 100% The following 5 package(s) will be affected (of 0 checked): New packages to be INSTALLED: python3: 3_3 python35: 3.5.3_1 libffi: 3.2.1 indexinfo: 0.2.6 gettext-runtime: 0.19.8.1_1 Number of packages to be installed: 5 The process will require 103 MiB more space. 14 MiB to be downloaded. Proceed with this action? [y/N]: y [e077349d-37c5-11e7-b678-00241daad556] [1/5] Fetching python3-3_3.txz: 100% 1 KiB 1.1kB/s 00:01 [e077349d-37c5-11e7-b678-00241daad556] [2/5] Fetching python35-3.5.3_1.txz: 100% 14 MiB 833.3kB/s 00:18 [e077349d-37c5-11e7-b678-00241daad556] [3/5] Fetching libffi-3.2.1.txz: 100% 35 KiB 36.2kB/s 00:01 [e077349d-37c5-11e7-b678-00241daad556] [4/5] Fetching indexinfo-0.2.6.txz: 100% 5 KiB 5.3kB/s 00:01 [e077349d-37c5-11e7-b678-00241daad556] [5/5] Fetching gettext-runtime-0.19.8.1_1.txz: 100% 147 KiB 151.0kB/s 00:01 Checking integrity... done (0 conflicting) [e077349d-37c5-11e7-b678-00241daad556] [1/5] Installing indexinfo-0.2.6... [e077349d-37c5-11e7-b678-00241daad556] [1/5] Extracting indexinfo-0.2.6: 100% [e077349d-37c5-11e7-b678-00241daad556] [2/5] Installing libffi-3.2.1... [e077349d-37c5-11e7-b678-00241daad556] [2/5] Extracting libffi-3.2.1: 100% [e077349d-37c5-11e7-b678-00241daad556] [3/5] Installing gettext-runtime-0.19.8.1_1... [e077349d-37c5-11e7-b678-00241daad556] [3/5] Extracting gettext-runtime-0.19.8.1_1: 100% [e077349d-37c5-11e7-b678-00241daad556] [4/5] Installing python35-3.5.3_1... [e077349d-37c5-11e7-b678-00241daad556] [4/5] Extracting python35-3.5.3_1: 100% [e077349d-37c5-11e7-b678-00241daad556] [5/5] Installing python3-3_3... [e077349d-37c5-11e7-b678-00241daad556] Extracting python3-3_3: 100% Message from python35-3.5.3_1: =========================================================================== Note that some standard Python modules are provided as separate ports as they require additional dependencies. They are available as: py35-gdbm databases/py35-gdbm py35-sqlite3 databases/py35-sqlite3 py35-tkinter x11-toolkits/py35-tkinter ===========================================================================
Installacion de py35-sqlite3
root@e077349d-37c5-11e7-b678-00241daad556:~ # pkg install py35-sqlite3
Installacion de py35-tkinter
root@e077349d-37c5-11e7-b678-00241daad556:~ # pkg install py35-tkinter
Environament PYTHON3
root@e077349d-37c5-11e7-b678-00241daad556:~ # pkg install wget Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 2 package(s) will be affected (of 0 checked): New packages to be INSTALLED: wget: 1.19 libidn: 1.33_1 Number of packages to be installed: 2 The process will require 4 MiB more space. 811 KiB to be downloaded. Proceed with this action? [y/N]: y [e077349d-37c5-11e7-b678-00241daad556] [1/2] Fetching wget-1.19.txz: 100% 611 KiB 625.4kB/s 00:01 [e077349d-37c5-11e7-b678-00241daad556] [2/2] Fetching libidn-1.33_1.txz: 100% 201 KiB 205.5kB/s 00:01 Checking integrity... done (0 conflicting) [e077349d-37c5-11e7-b678-00241daad556] [1/2] Installing libidn-1.33_1... [e077349d-37c5-11e7-b678-00241daad556] [1/2] Extracting libidn-1.33_1: 100% [e077349d-37c5-11e7-b678-00241daad556] [2/2] Installing wget-1.19... [e077349d-37c5-11e7-b678-00241daad556] Extracting wget-1.19: 100% root@e077349d-37c5-11e7-b678-00241daad556:~ # pkg install curl Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 3 package(s) will be affected (of 0 checked): New packages to be INSTALLED: curl: 7.54.0 libnghttp2: 1.21.0 ca_root_nss: 3.30.2 Number of packages to be installed: 3 The process will require 5 MiB more space. 1 MiB to be downloaded. Proceed with this action? [y/N]: y [e077349d-37c5-11e7-b678-00241daad556] [1/3] Fetching curl-7.54.0.txz: 100% 1 MiB 553.5kB/s 00:02 [e077349d-37c5-11e7-b678-00241daad556] [2/3] Fetching libnghttp2-1.21.0.txz: 100% 105 KiB 107.5kB/s 00:01 [e077349d-37c5-11e7-b678-00241daad556] [3/3] Fetching ca_root_nss-3.30.2.txz: 100% 329 KiB 336.6kB/s 00:01 Checking integrity... done (0 conflicting) [e077349d-37c5-11e7-b678-00241daad556] [1/3] Installing libnghttp2-1.21.0... [e077349d-37c5-11e7-b678-00241daad556] [1/3] Extracting libnghttp2-1.21.0: 100% [e077349d-37c5-11e7-b678-00241daad556] [2/3] Installing ca_root_nss-3.30.2... [e077349d-37c5-11e7-b678-00241daad556] [2/3] Extracting ca_root_nss-3.30.2: 100% [e077349d-37c5-11e7-b678-00241daad556] [3/3] Installing curl-7.54.0... [e077349d-37c5-11e7-b678-00241daad556] Extracting curl-7.54.0: 100% Message from ca_root_nss-3.30.2: ********************************* WARNING ********************************* FreeBSD does not, and can not warrant that the certification authorities whose certificates are included in this package have in any way been audited for trustworthiness or RFC 3647 compliance. Assessment and verification of trust is the complete responsibility of the system administrator. *********************************** NOTE ********************************** This package installs symlinks to support root certificates discovery by default for software that uses OpenSSL. This enables SSL Certificate Verification by client software without manual intervention. If you prefer to do this manually, replace the following symlinks with either an empty file or your site-local certificate bundle. * /etc/ssl/cert.pem * /usr/local/etc/ssl/cert.pem * /usr/local/openssl/cert.pem *************************************************************************** root@e077349d-37c5-11e7-b678-00241daad556:~ # wget https://bootstrap.pypa.io/get-pip.py --2017-05-13 11:30:51-- https://bootstrap.pypa.io/get-pip.py Resolving bootstrap.pypa.io... 151.101.60.175 Connecting to bootstrap.pypa.io|151.101.60.175|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1595408 (1.5M) [text/x-python] Saving to: 'get-pip.py' get-pip.py 100%[===============================================================================================>] 1.52M 1.05MB/s in 1.5s 2017-05-13 11:30:53 (1.05 MB/s) - 'get-pip.py' saved [1595408/1595408] root@e077349d-37c5-11e7-b678-00241daad556:~ # python3 get-pip.py Collecting pip Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB) 100% |################################| 1.3MB 469kB/s Collecting wheel Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) 100% |################################| 71kB 1.8MB/s Installing collected packages: pip, wheel Successfully installed pip-9.0.1 wheel-0.29.0