惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Announcements
Recent Announcements
IT之家
IT之家
Google DeepMind News
Google DeepMind News
罗磊的独立博客
爱范儿
爱范儿
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
U
Unit 42
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
B
Blog
博客园 - 叶小钗
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Bastille Blog | BastilleBSD

Welcome to the BastilleBSD Community Library Share Pkg Cache Between Jails | BastilleBSD Automating Ten Things To Do After Installing FreeBSD With Rocinante | BastilleBSD Ten Things To Do After Installing FreeBSD | BastilleBSD Bastille Template: AdGuard Home Exporter | BastilleBSD Bastille 0.9.20211225 Demo Livestream | BastilleBSD Closing Out 2021 With New Bastille Release | BastilleBSD Bastille Template: AdGuard Home | BastilleBSD Bastille New Year 2021 Bug Fix Release Notes | BastilleBSD Bastille Port Redirection and Persistence | BastilleBSD Bastille Default Templates and Customization | BastilleBSD Bastille New Year 2021 Release Notes | BastilleBSD Bastille Networking in Depth | BastilleBSD Bastille Groundhog Day Release | BastilleBSD Bastille pkg demo: Bastille in depth Series | BastilleBSD Bastille create demo: Bastille in depth series | BastilleBSD Bastille cmd demo: Bastille in depth Series | BastilleBSD Bastille bootstrap demo: Bastille in depth Series | BastilleBSD Getting Started Video | BastilleBSD Thanksgiving 2019 | BastilleBSD Release Notes - Captain Jack | BastilleBSD Regarding Updating | BastilleBSD
Experimenting With Ubuntu and Debian Linux Containers | B...
Christer Edwards · 2021-07-31 · via Bastille Blog | BastilleBSD
Experimenting with Debian and Ubuntu Containers

Bastille is an open-source system for automating deployment and management containerized applications on FreeBSD.


Experimental Linux

The Bastille 0.9.x series adds experimental support for Ubuntu and Debian containers. This Linux support extends to Ubuntu “bionic” and “focal” plus Debian “stretch” and “buster”.

This support is achieved using FreeBSD’s native Linux compatibility layer.

The linux module provides limited Linux ABI (application binary interface) compatibility, making it possible to run many unmodified Linux applications and libraries without the need for virtualization or emulation.

Disclaimer

Please note this support is still considered experimental. Not all binaries are guaranteed to work. Your mileage may vary.

That said, we’re excited to see what you can achieve with this feature!

Bootstrap

Before you can create Ubuntu or Debian containers you will need to bootstrap the release. This follows the same standard format to bootstrap a FreeBSD release.

Ubuntu 18.04 “Bionic Beaver”

Usage:

bastille bootstrap bionic

Example:

ishmael ~ # bastille bootstrap bionic
I: Retrieving InRelease
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://archive.ubuntu.com/ubuntu...
...

This will download and extract ~102M worth of packages using debootstrap.

Ubuntu 20.04 “Focal Fossa”

Usage:

bastille bootstrap focal

Example:

ishmael ~ # bastille bootstrap focal
I: Retrieving InRelease
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://archive.ubuntu.com/ubuntu...
...

This will download and extract ~109M worth of packages using debootstrap.

Debian 10 “Buster”

Usage:

bastille bootstrap buster

Example:

ishmael ~ # bastille bootstrap buster
I: Retrieving InRelease
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://deb.debian.org/debian...
...

This will download and extract ~144M worth of packages using debootstrap.

Debian 9 “Stretch”

Usage:

bastille bootstrap stretch

Example:

ishmael ~ # bastille bootstrap stretch
I: Retrieving InRelease
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://deb.debian.org/debian...
...

This will download and extract ~130M worth of packages using debootstrap.

Create Ubuntu Container

Creating Ubuntu containers uses the standard create syntax with the addition of the -L option, ie; bastille create -L name release ip.

Ubuntu 18.04

Usage:

bastille create -L name bionic ip

Example:

ishmael ~ # bastille create -L ubuntu-bionic bionic 10.17.89.18
Valid: (10.17.89.18).
Valid: (bastille0).
[ubuntu-bionic]:
ubuntu-bionic: created

Fetching packages...
...
All packages are up to date.

You will see a number of dpkg: warning: ignoring pre-dependency problem!. This is expected.

This will require ~218M of extracted packages.

Ubuntu 20.04

Usage:

bastille create -L name focal ip

Example:

ishmael ~ # bastille create -L ubuntu-focal focal 10.17.89.20
Valid: (10.17.89.20).
Valid: (bastille0).
[ubuntu-focal]:
ubuntu-focal: created

Fetching packages...
...
All packages are up to date.

You will see a number of dpkg: warning: ignoring pre-dependency problem!. This is expected.

This will require 237M of extracted packages.

Create Debian Container

Debian 9

Usage:

bastille create -L name stretch ip

Example:

ishmael ~ # bastille create -L debian-stretch stretch 10.17.89.09
Valid: (10.17.89.09).
Valid: (bastille0).
[debian-stretch]:
debian-stretch: created

Fetching packages...
...
All packages are up to date.

You will see a number of dpkg: warning: ignoring pre-dependency problem!. This is expected.

This will require ~229M of extracted packages.

Debian 10

Usage:

bastille create -L name buster ip

Example:

ishmael ~ # bastille create -L debian-buster buster 10.17.89.10
Valid: (10.17.89.10).
Valid: (bastille0).
[debian-stretch]:
debian-stretch: created

Fetching packages...
...
All packages are up to date.
...

You will see a number of dpkg: warning: ignoring pre-dependency problem!. This is expected.

This will require ~235M of extracted packages.

Example Login

The bastille console command works as expected with these Linux containers. You will be logged in as root and shown the motd.

Example: Bionic

brick ~ # bastille console ubuntu-bionic
[ubuntu-bionic]:
Welcome to Ubuntu 18.04 LTS (GNU/Linux 3.17.0 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Example: Focal

brick ~ # bastille console ubuntu-focal
[ubuntu-focal]:
Welcome to Ubuntu 20.04 LTS (GNU/Linux 3.17.0 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Example: Stretch

ishmael ~ # bastille console debian-stretch
[debian-stretch]:
Linux debian-stretch 3.17.0 FreeBSD 13.0-RELEASE-p3 #0: Tue Jun 29 19:46:20 UTC 2021 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Example: Buster

ishmael ~ # bastille console debian-buster
[debian-buster]:
Linux debian-buster 3.17.0 FreeBSD 13.0-RELEASE-p3 #0: Tue Jun 29 19:46:20 UTC 2021 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Automation

Initial support for automation has also been added by way of the CMD and PKG sub-commands. This means you can automate package installation and execute arbitrary commands on Linux containers.

Usage:

bastille pkg debian-buster install htop

Example:

[debian-buster]:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  lsof strace
The following NEW packages will be installed:
  htop
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 92.8 kB of archives.
After this operation, 230 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 htop amd64 2.2.0-1+b1 [92.8 kB]
Fetched 92.8 kB in 0s (412 kB/s)
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
Selecting previously unselected package htop.
(Reading database ... 9193 files and directories currently installed.)
Preparing to unpack .../htop_2.2.0-1+b1_amd64.deb ...
Unpacking htop (2.2.0-1+b1) ...
Setting up htop (2.2.0-1+b1) ...

Support for the CMD sub-command works in the same way. Again, your mileage may vary at this stage.

Usage:

bastille cmd debian-buster cat /etc/debian_version

Example:

ishmael ~ # bastille cmd debian-buster cat /etc/debian_version
[debian-buster]:
10.10
[debian-buster]: 0

Template (default/linux)

With the CMD and PKG sub-commands supported we are now able to use templates to automate Linux containers. This means by default the default/linux template is now applied to automate create steps.