Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Tyler Cipriani bb85ebc796 blubber.yaml: Bump pipeline version il y a 1 mois
.pipeline blubber.yaml: Bump pipeline version il y a 1 mois
api/openapi-spec Bump config version to v4 il y a 2 mois
build Remove support for `sharedvolume` configuration il y a 11 mois
cmd Bump config version to v4 il y a 2 mois
config Unit tests: PosOf InsertElement il y a 2 mois
docker Bump config version to v4 il y a 2 mois
docs Tweaked logo to play nice with preview renderer on commons il y a 8 mois
meta Capture and expose build-time meta data il y a 1 an
scripts Provide OpenAPI spec for Blubberoid il y a 9 mois
vendor Update go-playground validator il y a 3 mois
.gitignore Use JSON as canonical config format il y a 9 mois
.gitreview Add .gitreview file il y a 1 an
CONTRIBUTING.md Include a basic go.mod that declares the package name il y a 6 mois
Gopkg.lock Update go-playground validator il y a 3 mois
Gopkg.toml Update go-playground validator il y a 3 mois
LICENSE Add Apache License 2.0 il y a 2 ans
Makefile Make test: add coverage output il y a 2 mois
README.md Bump config version to v4 il y a 2 mois
VERSION Bump config version to v4 il y a 2 mois
blubber.example.yaml Bump config version to v4 il y a 2 mois
go.mod Include a basic go.mod that declares the package name il y a 6 mois
policy.example.yaml Update go-playground validator il y a 3 mois

README.md

Blubber

Very experimental proof of concept.

Blubber is a highly opinionated abstraction for container build configurations and a command-line compiler which currently supports outputting multi-stage Dockerfiles. It aims to provide a handful of declarative constructs that accomplish build configuration in a more secure and determinate way than running ad-hoc commands.

Example configuration

version: v4
base: debian:jessie
apt:
  packages: [libjpeg, libyaml]
lives:
  in: /srv/service
runs:
  environment:
    FOO: bar
    BAR: baz

variants:
  build:
    apt:
      packages: [libjpeg-dev, libyaml-dev]
    node:
      requirements: [package.json, package-lock.json]
    copies: [local]

  development:
    includes: [build]

  test:
    includes: [build]
    apt:
      packages: [chromium]
    entrypoint: [npm, test]

  prep:
    includes: [build]
    node:
      env: production

  production:
    base: debian:jessie-slim
    node:
      env: production
    copies: [prep]
    entrypoint: [node, server.js]

Variants

Blubber supports a concept of composeable configuration variants for defining slightly different container images while still maintaining a sufficient degree of parity between them. For example, images for development and testing may require some development and debugging packages which you wouldn’t want in production lest they contain vulnerabilities and somehow end up linked or included in the application runtime.

Properties declared at the top level are shared among all variants unless redefined, and one variant can include the properties of others. Some properties, like apt:packages are combined when inherited or included.

In the example configuration, the test variant when expanded effectively becomes:

version: v4
base: debian:jessie
apt:
  packages: [libjpeg, libyaml, libjpeg-dev, libyaml-dev, chromium]
node:
  dependencies: true
runs:
  in: /srv/service
  as: runuser
  uid: 666
  gid: 666
entrypoint: [npm, test]

Artifacts

When trying to ensure optimally sized Docker images for production, there’s a common pattern that has emerged which is essentially to use one image for building an application and copying the resulting build artifacts to another much more optimized image, using the latter for production.

The Docker community has responded to this need by implementing multi-stage builds and Blubber makes use of this with its copies configuration property.

In the example configuration, the production variant declares artifacts to be copied over from the result of building the prep image.

Usage

Running the blubber command will be produce Dockerfile output for the given variant.

blubber config.yaml variant

You can see the result of the example configuration by cloning this repo and running (assuming you have go):

make
./bin/blubber blubber blubber.example.yaml development
./bin/blubber blubber blubber.example.yaml test
./bin/blubber blubber blubber.example.yaml production

Contribution

If you’d like to make code contributions to Blubber, see CONTRIBUTING.md.