Wikipedia said: In much the same way as the trade or vocation of smithing produced the common English surname Smith and the German name Schmidt, the cooper trade is also the origin of German names like Kübler.
There is still demand for high-quality
wooden barrelscontainers, and it is thought that the highest-qualitybarrelscontainers are those hand-made by professionalcooperskublers.
A generic, extendable build orchestrator, in Bash. The default batteries focus on creating and maintaining Docker base images.
Perhaps:
build
command that keep
getting into your way. Wouldn't it be nice if you could docker build
your images with all
docker run
args, like -v
, at your disposal? Or if your Dockerfile
was fully parameterizable?Optional:
# Assuming a working gpg setup just import the Gentoo ebuild repository signing key:
gpg --keyserver keys.gentoo.org --recv-keys E1D6ABB63BFCFB4BA02FDF1CEC590EEAC9189250
An ebuild can be found at https://github.com/edannenberg/kubler-overlay/
Add the overlay (see link for instructions) and install as usual:
emerge -av kubler
The standard version of Bash in macOS is too old. Easiest way to upgrade to a later version is to use Homebrew. Once Homebrew is installed, update Bash:
$ brew install bash
This will install an updated version of Bash in /usr/local/bin/
. To make it your default shell, you need to edit
Advanced Options...
in System Preferences. Just right-click your user icon to find the option.
Also, macOS does not load ~/.bashrc
by default, but uses ~/.bash_profile
, so when following the instructions
below, make sure to edit the correct file.
Kubler has been tested on Gentoo, CoreOS and macOS. It should run on all Linux distributions. Feel free to open an issue or ask on Discord if you run into problems.
$ cd ~/tools/
$ curl -L https://github.com/edannenberg/kubler/archive/master.tar.gz | tar xz
kubler.sh
to your pathThe recommended way is to add the following at the end of your ~/.bashrc
file, don't forget to adjust the
Kubler path for each line accordingly:
export PATH="${PATH}:/path/to/kubler/bin"
# optional but highly recommended, adds bash completion support for all kubler commands
source /path/to/kubler/lib/kubler-completion.bash
Note: You will need to open a new shell for this to take effect, if this fails on a Linux SystemD host re-logging might be required instead.
Kubler doesn't require any further configuration but you may want to review the main config file
located at /etc/kubler.conf
. If the file doesn't exist the kubler.conf
file in Kubler's root folder is
used as a fallback.
All of Kubler's runtime data, like user config overrides, downloads or custom scripts, is kept at a path defined
via KUBLER_DATA_DIR
. This defaults to ~/.kubler/
, which is suitable if user accounts have Docker/Podman access on the host.
If you plan to use Docker/Podman/Kubler only with sudo
, like on a server, you may want to use /var/lib/kubler
, or some other location, as data dir instead.
Managing your KUBLER_DATA_DIR
with a VCS tool like Git is supported, a proper .gitignore
is added on initialization.
$ kubler clean -N
Remove Kubler itself:
emerge -C kubler
then remove the kubler overlayDelete any namespace dirs and configured KUBLER_DATA_DIR
(default is ~/.kubler/
) you had in
use, this may require su permissions.
To get a quick overview of available commands/options:
$ kubler --help
Or to view details for a specific command:
$ kubler build -h
Per default almost all of Kubler's commands will need to be run from a --working-dir
, if the option is
omitted the current working dir of the executing shell is used. It behaves much like Git in that
regard, executing any Kubler command from a sub directory of a valid working dir will also work as
expected.
A --working-dir
is considered valid if it has a kubler.conf
file and either an images/
dir, or
one ore more namespace dirs, which are just a collection of images.
Kubler currently ships with Docker and Podman build engines. The rest of this tour will focus on building Docker images, it's worth noting that the build process may be completely different, i.e. it may not involve Gentoo or Docker at all, for other build engines.
If you are not familiar with Gentoo some of it's terms you will encounter may be confusing, a short 101 glossary:
stage3 | A tar ball provided by Gentoo which on extraction provides an almost-complete root file system for a Gentoo installation |
Portage | Gentoo's default package manager, this is where all the magic happens |
emerge | Portage's main executable |
ebuild | text file which identifies a specific software package and how Portage should handle it |
Portage Tree | Categorized collection of ebuilds, Gentoo ships with ~20k ebuilds |
Portage Overlay | Additional ebuild repository maintained by the community/yourself |
To accommodate different use cases there are three types of working dirs:
multi | The working dir is a collection of one or more namespace dirs |
single | The working dir doubles as namespace dir, you can't create a new namespace in it, but you save a directory level |
local | Same as multi but --working-dir is equal to KUBLER_DATA_DIR |
First switch to a directory where you would like to store your Kubler managed images or namespaces:
$ cd ~/projects
Then use the new
command to take care of the boiler plate, choose 'single' when asked for the namespace type:
$ kubler new namespace mytest
$ cd mytest/
Although not strictly required it's recommended to install Kubler's example images by running:
$ kubler update
Let's start with a simple task and dockerize [Figlet][], a nifty tool that produces ascii fonts. First create a new image stub:
$ kubler new image mytest/figlet
When asked for the image parent, enter kubler/bash
and bt
when asked for tests:
»»» Extend an existing Kubler managed image? Fully qualified image id (i.e. kubler/busybox) or scratch
»[?]» Parent Image (scratch): kubler/bash
»»»
»»» Add test template(s)? Possible choices:
»»» hc - Add a stub for Docker's HEALTH-CHECK, recommended for images that run daemons
»»» bt - Add a stub for a custom build-test.sh script, a good choice if HEALTH-CHECK is not suitable
»»» yes - Add stubs for both test types
»»» no - Fck it, we'll do it live!
»[?]» Tests (hc): bt
»»»
»[✔]» Successfully created new image at projects/mytest/images/figlet
A handy feature when working on a Kubler managed image is the --interactive
build arg. As the name suggests it
allows us to poke around in a running build container and plan/debug the image build. Let's give it a try:
$ kubler build mytest/figlet -i
This will also build any missing parent images/builders, so the first run may take quite a bit of time. Don't worry, once the local binary package cache and build containers are seeded future runs will be much faster. When everything is ready you are dropped into a new shell:
»[✔]»[kubler/bash]» done.
»»»»»[mytest/figlet]» using: docker / builder: kubler/bob-bash
kubler-bob-bash / #
To search Portage's package db you may use eix
, or whatever your preferred method is:
kubler-bob-bash / # eix figlet
* app-misc/figlet
Available versions: 2.2.5 ~2.2.5-r1
Homepage: http://www.figlet.org/
Description: program for making large letters out of ordinary text
* dev-php/PEAR-Text_Figlet
As with most package managers, software in Portage is grouped by categories. The category and package name combined
form a unique package atom, in our case we want to install app-misc/figlet
.
Now manifest the new found knowledge by editing the image's build script:
kubler-bob-bash / # nano /config/build.sh
Note: The /config
folder in the build container is the host mounted image directory at mytest/images/figlet/
.
Feel free to use your local IDE/editor to edit build.sh
instead.
Add the app-misc/figlet
package atom to the _packages
variable in build.sh
:
_packages="app-misc/figlet"
Then start a test run of the first build phase (more on that later), if you are in a hurry you may skip this step:
kubler-bob-bash / # kubler-build-root
Once this finishes exit the interactive builder by hitting crtl+d
or typing exit
. All that is left to do is
building the actual image:
$ kubler build mytest/figlet -nF
The args are short hand for --no-deps
and --force-full-image-build
, omitting -n
would also rebuild all
parent images, which can be handy but is just a waste of time in this case.
»[✘]»[mytest/figlet]» fatal: build-test.sh for image mytest/figlet:20190228 failed with exit signal: 1
Oops, looks like we forgot the image test. Let's fix that by editing the mentioned build-test.sh
file:
#!/usr/bin/env sh
set -eo pipefail
# check figlet version string
figlet -v | grep -A 2 'FIGlet Copyright' || exit 1
Not exactly exhausting but it will do for now. Rebuild the image again but this time only pass -f
instead of -F
,
this too forces an image rebuild but skips the first build phase:
$ kubler build mytest/figlet -nf
»[✔]»[mytest/figlet]» done.
$ docker run -it --rm mytest/figlet figlet foooo
$ tree images/figlet
images/figlet/
├── Dockerfile <- generated, never edit this manually
├── Dockerfile.template <- standard Dockerfile, except it's fully parameterizable
├── PACKAGES.md <- generated, lists all installed packages with version and use flags
├── README.md <- optional, image specific documentation written by you
├── build-test.sh <- optional, if the file exists it activates a post-build test
├── build.conf <- general image/builder config, sourced on the host
├── build.sh <- configures the first build phase, only sourced in build containers
The stub files generated with the new
command are heavily commented with further details.
After executing a build command an image dependency graph is generated for the passed target ids by parsing
the IMAGE_PARENT
and BUILDER
vars in the respective build.conf
files. You can visualize the graph for any
given target ids with the dep-graph
command:
$ kubler dep-graph -b kubler/nginx mytest
Once all required data is gathered, each missing, as in not already built, image will go through a two phase build process:
The configured builder image is passed to docker run
to produce a rootfs.tar
file in the image folder
/config
build-root.sh
(a generic script provided by Kubler) inside build containerbuild-root.sh
reads build.sh
from the mounted /config
directoryconfigure_builder()
hook is defined in build.sh
, execute itpackage.installed
file is generated which is used by depending images as [package.provided][]ROOT
env is set to custom pathconfigure_rootfs_build()
hook is defined in build.sh
, execute it_packages
defined in build.sh
are installed via Portage at custom empty root directoryfinish_rootfs_build()
hook is defined in build.sh
, execute itROOT
dir is packaged as rootfs.tar
and placed in image dir on the hostThe build-root.sh
file effectively just uses a feature of Gentoo's package manager that allows us to install any given _packages
,
with all it's dependencies, at a custom path by setting the ROOT
env in the build container. The other piece to the
puzzle is Portage's [package.provided][] file which is constantly updated and preserved by committing the build
container as a new builder image after each build. Thanks to Docker's shared layers the overhead of this is fairly minimal.
Kubler's default build container names generally start with bob
, when a new build container state is committed the
current image name gets appended. For example kubler/bob-openssl
refers to the container used to build the kubler/openssl
image.
Any image that has kubler/openssl
as IMAGE_PARENT
will use kubler/bob-openssl
as it's build container.
There are no further assumptions or magic, the hooks in build.sh
AI小说写作助手,一站式润色、改写、扩写
蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。
字节跳动发布的AI编程神器IDE
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。
全能AI智能助手,随时解答生活与工作的多样问题
问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。
实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。
一键生成PPT和Word,让学习生活更轻松
讯飞智文是一个利用 AI 技术的项目 ,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。
深度推理能力全新升级,全面对标OpenAI o1
科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。
一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型
Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。
AI助力,做PPT更简单!
咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。
选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。
专业的AI公文写作平台,公文写作神器
AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。
最新AI工具、AI资讯
独家AI资源、AI项目落地
微信扫一扫关注公众号