Jail management tool for FreeBSD, written in Go. Support iocage jails, so they can coexist. Gocage is meant to be a complete jail management tool with network, snapshots, jail cloning support and a web interface.
Go to file
2021-12-19 16:51:26 +01:00
cmd Add filter option, update Readme 2021-12-19 16:49:07 +01:00
jail Init 2021-12-18 13:13:25 +01:00
.gitignore Init 2021-12-18 13:13:25 +01:00
go.mod Init 2021-12-18 13:13:25 +01:00
gocage.conf.yml update config sample with nolinesep 2021-12-19 14:34:15 +01:00
LICENSE Initial commit 2021-11-27 10:43:28 +01:00
main.go Init 2021-12-18 13:13:25 +01:00
README.md Mise à jour de 'README.md' 2021-12-19 16:51:26 +01:00
TODO.md Init 2021-12-18 13:13:25 +01:00

gocage

Jail management tool for FreeBSD, written in Go.
Support iocage jails, so they can coexist.
Gocage is meant to be a complete jail management tool with network, snapshots, jail cloning support and a web interface.

List jails

Nothing fancy, use
gocage list

Specify fields to display

Use -o to specify which fields you want to display:
gocage list -o JID,Name,Running,Config.Boot,Config.Comment +=====+==========+=========+=============+================+ | JID | Name | Running | Config.Boot | Config.Comment | +=====+==========+=========+=============+================+ | 183 | test | true | 1 | none | +-----+----------+---------+-------------+----------------+ | 29 | srv-irc | true | 1 | | +-----+----------+---------+-------------+----------------+ | | srv-web | false | 0 | | +-----+----------+---------+-------------+----------------+ | 22 | srv-dns1 | true | 1 | | +-----+----------+---------+-------------+----------------+

## Filter jails

By name

Just add name on gocage list command :
gocage list srv-bdd srv-web +=====+=========+=================+=======================+=========+ | JID | Name | Config.Release | Config.Ip4_addr | Running | +=====+=========+=================+=======================+=========+ | 98 | srv-db | 13.0-RELEASE-p5 | vnet0|192.168.1.56/24 | true | +-----+---------+-----------------+-----------------------+---------+ | 41 | srv-web | 13.0-RELEASE-p4 | vnet0|192.168.1.26/24 | true | +-----+---------+-----------------+-----------------------+---------+

By field value

You can filter jails with -f option, followed by key=value. Suppose you want to see only active at boot jails:
gocage list -f Config.Boot=1 -o JID,Name,Running,Config.Boot,Config.Comment +=====+==========+=========+=============+================+ | JID | Name | Running | Config.Boot | Config.Comment | +=====+==========+=========+=============+================+ | 183 | test | true | 1 | none | +-----+----------+---------+-------------+----------------+ | 29 | srv-irc | true | 1 | | +-----+----------+---------+-------------+----------------+ | | srv-db | false | 1 | none | +-----+----------+---------+-------------+----------------+ | 22 | srv-dns1 | true | 1 | | +-----+----------+---------+-------------+----------------+

Now, only active at boot and running :
gocage list -f Config.Boot=1,Running=true -o JID,Name,Running,Config.Boot +=====+==========+=========+=============+ | JID | Name | Running | Config.Boot | +=====+==========+=========+=============+ | 183 | test | true | 1 | +-----+----------+---------+-------------+ | 29 | srv-irc | true | 1 | +-----+----------+---------+-------------+ | 22 | srv-dns1 | true | 1 | +-----+----------+---------+-------------+