rafecolton / docker-builder Goto Github PK
View Code? Open in Web Editor NEWDocker builder builds Docker images from a friendly config file.
License: MIT License
Docker builder builds Docker images from a friendly config file.
License: MIT License
If we try to run builder from somewhere else, bad things happen:
parser/tag/tag.go
What should we do instead? Since we're shelling out to git
, we should probably use the Bobfile
's directory as top instead of $PWD
maybe with bats
, since it's pretty universal
If multiple containers are being built as tags of the same repo, they probably only need to be pushed once.
It would be great if I could run the HTTP server and specify a Bobfile for a path. Then I could give that path to Travis webhooks and have it hit the build server after successful CI.
Something like http://localhost:5000/docker-build/project/travis
, perhaps?
$BOB_WORK_DIR
$BOB_DOCKER_CREDS
Make it a required field and keep around old struct versions to make sure everything is in sync
And move package builder
to the builder/
directory
I want to put docker-builder behind an AWS EC2 Elastic Load Balancer, but it requires a health check to make sure the instance is in service. Let's add a route at /health
that always returns 200.
exits 2
, which is ok - should at least handle the error gracefully if possible and not panic
Since the user has limited control over the data sent with a Travis/GitHub webhook, certain options will have to be specified statically in the repo.
The suggested implementation for this is a .bobconfig
file at the top level of the repo. Example options to be included in the .bobconfig
are the default Bobfile and container group to be built (ala #96)
There are a couple of things to consider:
Bobfile
? If so, how do we deal with private information (i.e. api tokens) in the Bobfile
of a public repo? Something like travis secure env vars is possible, but not ideal given that there is no centralized docker-builder service.It would be nice if this waited until after the push completed in case you want to block until you are able to pull the container for testing or deployment.
and various other container-building strategies
Make sure log level can be set externally if used as a library.
Also, container output seems a bit verbose - should it only be printed when log level is set to "debug" and not "info"?
The tests that copy files from the repo dir to the workdir occasionally fail
Do we have a race condition?
Possible causes:
A go get
of github.com/modcloth/docker-builder
tries to use master
rather than the travis-auth
branch. I've worked around this by just using the binary release for the interim. I'm not sure if the correct course is to just update the README to direct users to the releases.
Maybe totals as well as separate times for builds and pushes?
Due to http://golang.org/doc/go1.3#map (in Go 1.3, maps are iterated over in a random order).
This can be fixed by using a different data structure in the Bobfile, but that will require a significant refactor as well as the implementation of versioning for the Bobfiles (per #8)
Fix has been started in the bobfile-version-1 branch
Maybe "docker-builder" - otherwise this will never get discovered. Plus I'm still not sold on the name.
If no API token is provided to the build server itself, and the request comes through on a webhook as opposed to a request to /docker-build
, it wouldn't be possible to clone down a private repo. Do we care? If so, proposed solutions?
Specifically, find a way to remove this code: https://github.com/modcloth/docker-builder/blob/3d7b23b0073a9dc423011d011c5950ababb7f2b1/builder/bob.go#L157-L162
(And then the Type()
function can also be removed from the DockerCmd
interface)
into the Dockerfile
. Allow them to be retrieved from the docker-builder
process env
Builds on the same build server aren't isolated from each other. This could definitely be a problem if we build a bunk version of a container upon which another container depends. Addressing this will be quite involved and may involve a re-architect of the whole build server system.
Welcoming suggestions on the design for this.
Some requests get an error when posted via curl:
curl -XPOST -H Content-Type: application/json -u USERNAME:PASSWORD --connect-timeout 10 --silent --show-error https://bob.core-os.net/docker-build -d '
{
"account": "USERNAME",
"repo": "PROJECT",
"ref": "27e5c49b64c846dc5d814945a16dd49384e022bb",
"api_token": "APITOKEN",
"sync": true
}
'
curl: (52) Empty reply from server
Will dig into this.
Would probably make it easier to use with tests
In my setting, I have many different services under the same git repo. I need to build like 5-6 different images and i'd like to not have to build all of them everytime I push to github or perhaps even when I manually queue a build via the REST interface.
It would be very helpful adding a [[container]] name or a bobfile path when doing something like the following:
curl -s -XPOST http://localhost:5000/jobs -d '{"account":"modcloth","repo":"docker-builder","ref":"master","bobfile":"services/backend-service-1/Bobfile"}'
or maybe:
curl -s -XPOST http://localhost:5000/jobs -d '{"account":"modcloth","repo":"docker-builder","ref":"master","container_name":"backend-service-1"}'
cc @rafecolton
I believe this to be caused by an issue within queued-command-runner
. Will be addressed with a current pull request that, among other things, removes the queued-command-runner
from use. Will link to the issue shortly.
Right now it isn't possible to just do a docker build .
since the quay.io registry is private. It would be nice to have a Dockerfile.public or something similar to push up to docker.io (modcloth/docker-buiilder) or allow users to easily build a container.
Looks like bob includes "<IMG>
" in the command instead of the tag_opts
Add something like bob.BuildFromFile()
so it is no longer necessary to explicitly call Parse()
before calling Build()
The issue detailed in the description here is still happening.
and I want to be able to use go get
. ๐บ ๐
Verify that a failed bats
test will still correctly mark the travis run as failed.
It's annoying to dig through all of the logs that are just GET requests for /health. Let's silence the output here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.