Package: ibuilder
READMEibuilder is aclibased builder ofdockerimages. It provides an interface for building and pushing the image, signing images, as well as for tagging source code after build with a build version and other common image tasks.Latest Changesreplaced black, flake8, isort with ruffupgraded packages: idna, pygments, rich, types-python-dateutil, typing-extensions, urllib3, websocket-clientadd modified [date] to --version & standardize version metadataNOTICESthis app uses tomli for toml parsing, python 3.11 has tomllib included which we will move to at some point in the near future. We realize this could be a large burden on users so we have delayed this task until python 3.11 is more widely used.Featuresbuild: build docker imagespush: push images to any container registrysign: sign images for container signing and verificationsource control: tag and push when you build an imagehistory: retain build history for quick/easy access to past build infoquick/easy: create anibuilder.tomlfile and runib build -i minorto build, push, commit to source control and sign a new imageRequirementspython 3docker: docker must be set up as it is used to build and push the imagegit: (optional) if you use the source-tag feature you will need git installed and your code setup in git (it simply performs a git tag && git push from the working directory)image signor: (optional) if you choose to sign images a signor (such as cosign) is neededOverviewsetup (see #setup)configure (see #configure): place a copy of theexample/.ibuilder.tomlin the same directory as your Dockerfile of the app you want to build and adjust it as neededrun (see #run): execute ibuilder to build/push/tag a version of your app, its as simple asib buildInstallWe recommend usingpipxto install ibuilder:pipx install ibuilder. You can also install via pip:pip install --user ibuilder.Setupibuilder uses a config file to store your setup. Each 'app' you build with ibuilder expects this file to be in the 'root' of the app that you are building. This file contains information such as whether to build, push, tag the image, labels to apply, Dockerfile to use, etc. You can grab an example config file fromibuilder/example/.ibuilder.toml.Configurecreate a project config fileplace a copy of theexample/.ibuilder.tomlfile in your project (same directory as your Dockerfile) and configure as neededFeaturesIf you create an arg with the name "BUILD_VERSION" its value will be replaced with the build version of the current build. This can be used to pass the build version from ibuilder into your docker environment.Runbasic run:ib build --version=1.2.3the above command assumes there is a.ibuilder.tomlin the current working directory which happens to be in the same directory as the Dockerfile which you wish to buildchange logging level:LOG_LEVEL=DEBUG ib build...standard python log levels supported: CRITICAL|ERROR|WARNING|INFO|DEBUG (default is INFO)
View help withib --helpor see help for a specific command:ib build --help.RecommendationsWe recommend using docker's configuration storage for reg_auth-* related configuration items as it encrypts sensitive information and is likely already configured (if you have already useddocker login). If you leave the remaining items empty the default values will be used. This will then try$HOME/.docker/config.jsonand$HOME/.dockercfgfor your docker config settings. If you do not already have a docker config rundocker loginand it should be created for you. After a successful login you should not need to do anything else for the application as the needed info will be stored in your dockercfg and the app will use it when needed.If you are signing your images you may want to set theCOSIGN_PASSWORDenvironment variable in your~/.bashrcor equivalent shell config file to avoid being prompted for your signing password after build and push. It should be noted that you will be prompted twice (if you are pushing both the build version and thelatesttag of this version) as ib signs both tags of the built image. To avoid this we recommend setting theCOSIGN_PASSWORDenvironment variable but please ensure you understand the security implications of doing so.LegacyThis project originally started under the name boi - builder of images and as such you may find references to boi and even backward support for boi (e.g. local history database, user config file, etc.).Linkstyperdockerdocstoml