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.
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).
golangbase image as usual.
cbcommand 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 ...
go get -u github.com/hiroshi/cb
Make sure you have
$GOPATH/bin in your
cb SOURCE.tar.gz --config CONFIG.(json|yml)
sourcefield in config will be ignored as well as
gcloud alpha container builds createdo. Specify SOURCE as 1st argument.
imagesfield in config will be ignored. The
cbcommand is intended for local builds so always pushing images are not supposed to be welcome.
docker volume create.
docker runan image with volumes
docker buildor anything in container with SOURCE at hand.
stepsfield of CONFIG.
Do you get it? No? See and run examples, I hope it may help you understand.