All Projects â†’ hiroshi â†’ Cb

hiroshi / Cb

Licence: mit
Build container images locally using Google Cloud Container Builder compatible config file. 2017-08-22: Now there is official alternative https://github.com/GoogleCloudPlatform/container-builder-local.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cb

Docker Node
Official Docker Image for Node.js 🐳 🐢 🚀
Stars: ✭ 6,873 (+31140.91%)
Mutual labels:  docker-image
Docker Postgis
Docker image for PostGIS
Stars: ✭ 821 (+3631.82%)
Mutual labels:  docker-image
Docker Jenkins
Jenkins with Blue Ocean and support for builiding jobs in Docker
Stars: ✭ 18 (-18.18%)
Mutual labels:  docker-image
Scratch Node
Distroless Node.js Docker Images
Stars: ✭ 778 (+3436.36%)
Mutual labels:  docker-image
Metasfresh
We do Open Source ERP - Fast, Flexible & Free Software to scale your Business.
Stars: ✭ 807 (+3568.18%)
Mutual labels:  docker-image
Docker Dante Telegram
dante config builder for Telegram SOCKS-proxy & Dockerfile for building image with such proxy
Stars: ✭ 16 (-27.27%)
Mutual labels:  docker-image
Docker Bind
Dockerize BIND DNS server with webmin for DNS administration
Stars: ✭ 769 (+3395.45%)
Mutual labels:  docker-image
Up Node8
The way this project is packaging the Node 8 app isn't the best. Try the official example of Apex Up that uses the Node binary!
Stars: ✭ 22 (+0%)
Mutual labels:  docker-image
Azurite
A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
Stars: ✭ 810 (+3581.82%)
Mutual labels:  docker-image
Docker Lambda Packager
A docker image based on Amazon Linux to create packages for AWS Lambda 🐳 🐜
Stars: ✭ 18 (-18.18%)
Mutual labels:  docker-image
Androidsdk
🐳 Full-fledged Android SDK Docker Image
Stars: ✭ 776 (+3427.27%)
Mutual labels:  docker-image
Aria2 Pro Docker
Aria2 Pro | A perfect Aria2 Docker image | 更好用的 Aria2 Docker 容器镜像
Stars: ✭ 802 (+3545.45%)
Mutual labels:  docker-image
Docker Sonarqube
🐳 SonarQube in Docker
Stars: ✭ 894 (+3963.64%)
Mutual labels:  docker-image
Spilo
Highly available elephant herd: HA PostgreSQL cluster using Docker
Stars: ✭ 776 (+3427.27%)
Mutual labels:  docker-image
Traefik Certs Dumper
Dumps Let's Encrypt certificates of a specified domain which Traefik stores in acme.json.
Stars: ✭ 20 (-9.09%)
Mutual labels:  docker-image
Flannel
flannel is a network fabric for containers, designed for Kubernetes
Stars: ✭ 6,905 (+31286.36%)
Mutual labels:  docker-image
Bludit
Simple, Fast, Secure, Flat-File CMS
Stars: ✭ 824 (+3645.45%)
Mutual labels:  docker-image
Element Web
element.io docker image generator
Stars: ✭ 21 (-4.55%)
Mutual labels:  docker-image
Tizen4docker
Docker based solution to run Tizen Studio IDE on ANY Linux distro.
Stars: ✭ 22 (+0%)
Mutual labels:  docker-image
Mpsec
One Stop MPTCP Service : MPSec
Stars: ✭ 18 (-18.18%)
Mutual labels:  docker-image

cb - a Container Builder

It builds container images locally using Google Cloud Container Builder config file.

Why not just do docker build? It will be useful to provide an easy way to manage multiple steps builds.

  • We love small docker images:
    • Don't want to contain golang environment. We love a single go binary docker image.
    • Don't Want to contain frontend js build environment for a web app.

What it looks like?

steps:
- name: gcr.io/cloud-builders/docker
  args: ["build", "-t", "cb-build", "-f", "Dockerfile.build", "."]
- name: cb-build
  args: ["cp", "/go/src/cb/cb", "/workspace"]
- name: gcr.io/cloud-builders/docker
  args: ["build", "-t", "cb", "."]

This is an example config file. It will build a golang single binary image of cb command itself (not useful though).

  • 1st step - Build a temporary image. It builds a go binary using golang base image as usual.
  • 2nd step - Run the resulted image of 1st step. It copies the golang binary in the image to workspace volume.
  • 3rd step - Build a final image from scratch. Just add the cb command from workplace volume.
$ docker images
REPOSITORY      TAG          IMAGE ID            CREATED             SIZE
cb              latest       05994f135ea4        2 days ago          3.208 MB
cb-build        latest       61f9b946f604        2 days ago          680.9 MB
...

Install

go get -u github.com/hiroshi/cb

Make sure you have $GOPATH/bin in your $PATH.

Usage

cb SOURCE.tar.gz --config CONFIG.(json|yml)

Notes

  • The source field in config will be ignored as well as gcloud alpha container builds create do. Specify SOURCE as 1st argument.
  • The images field in config will be ignored. The cb command is intended for local builds so always pushing images are not supposed to be welcome.

How it works

    1. Create a volume for workspace with docker volume create.
    1. Expand SOURCE into the workspace volume with docker copy.
    1. docker run an image with volumes /var/run/docker.sock//var/run/docker.sock/, WORKSPACE_VOLUME:/workspace.
    • If the image have docker command like this, you can do docker build or anything in container with SOURCE at hand.
    1. Repeat 3) with different image and args as you specifed in steps field of CONFIG.

Do you get it? No? See and run examples, I hope it may help you understand.

Examples

make run-example

TODO

  • Support wait_for and id fields of steps

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].