Skip to content

Instantly share code, notes, and snippets.

duglin / darser-v2
Last active Aug 29, 2015
Docker Parser V2 Proposal
View darser-v2
- Parse each line of the Dockerfile the same way people expect sh to do it
See below from the BASH man page but basically take into account quotes/spaces/etc
- Once parsed, the array of words (argv[]) will then be passed on to each command
Similar to how the client does it, each command can then use arg parsers (eg. pkg/flag) to deal
with options if they want.
- This means that we may see Dockerfile commands that look like:
COPY -R <src> <dest>
This provides us much more flexibility in the future to add additional semantics to exiting
commands through flags
duglin / Derrors
Last active Aug 29, 2015
Docker Error Reporting via REST API
View Derrors
Right now the daemon will return errors as plain text in the HTTP body. For example:
$ docker stop qwe
results in:
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
Date: Fri, 21 Nov 2014 19:24:28 GMT
Content-Length: 23
No such container: qwe
View gist:139b2e6e02a866e339d5
package main
import (
func main() {
View gist:cc2dedbabd6a46f8bdbb
dockerfiles/tomaszzielinski/test : Skipping unknown instruction PIP
dockerfiles/tetheredge/docker-ruby : Skipping unknown instruction VERSION
dockerfiles/gr4y/docker-java : Skipping unknown instruction OPENJDK-7-JRE/DOCKERFILE
dockerfiles/dmitry1993/DockerNode10-29 : Skipping unknown instruction CMD[
dockerfiles/inspiredbusiness/docker-odoo-dev : Skipping unknown instruction &&
dockerfiles/inspiredbusiness/nginx-proxy : Skipping unknown instruction &&
dockerfiles/jaigouk/data-only-container : Skipping unknown instruction &&
dockerfiles/jaigouk/data-only-container : Skipping unknown instruction &&
dockerfiles/iracooke/protk-dockerfile : Skipping unknown instruction PROTK-1.4.0/DOCKERFILE
dockerfiles/idi-ops/docker-java : Skipping unknown instruction OPENJDK-7/DOCKERFILE
duglin / gist:16560611876ce5f6adb7
Last active Aug 29, 2015
Docker Config File Package
View gist:16560611876ce5f6adb7
Problem: Need a better config file manager for Docker
There are several issues this PR is trying to address
1 - the current Docker CLI config file is really just used as a store for registry authentication data.
This makes it hard to use for other config options, like storing the value of DOCKER_HOST.
2 - 3rd party tooling, that might wish to modify any config values we store in a config file, would
have to write their own config file parser/editor - which is error prone
3 - end users who wish to modify any config file properties would either need to creat their own tooling,
or bring up the config file in an editor and hack at it, again all error prone.
duglin / ConfigFileRequirements
Last active Aug 29, 2015
Config File Requirements
View ConfigFileRequirements
My Immediate Needs:
- be able to extend the config file with new properties w/o breaking existing code
- in particular, I want to add new HTTP headers so I can add new code to docker to send them on each HTTP request
Longer-term things I think we'll need:
- allow for user to specify config file location when running docker (e.g docker --config <file> )
I think this is mainly needed so we can run multiple CLIs at the same time and each can have its own
config data - like auth headers, dockerHost, etc... and asking users to pass all of this in on the
cmd line or via env vars is a bit tedious.
View gist:b5508af4d3aa6cbaa5ed
+++ tar -cC /go/src/ .
+ go test TestBuildResourceConstraintsAreUsed -test.timeout=30m
--- FAIL: TestBuildResourceConstraintsAreUsed (0.18s)
docker_cli_build_test.go:5532: exit status 1 Sending build context to Docker daemon 2.048 kB
Step 0 : FROM hello-world:frozenntext to Docker daemon 2.048 kB
---> e45a5af57b00
Step 1 : RUN /hello
---> Running in 79d7c548b58c
time="2015-03-26T14:09:08Z" level=info msg="[8] System error: write /cgroup/cpuset/docker/66689499bbd08cd8dccc9b7bfd1d6b34e85d73ce8c84d3c69b5e91944322da60/docker/79d7c548b58c85c4cfad6cd01eb7c3b30db254d1014c496137edd93ddc528a6f/cpuset.cpus: invalid argument"
View gist:1ec730db1b667564efc6
Change integration-cli test output to:
[PASSED]: TestGetContainersAttachWebsocket
[PASSED]: TestContainerApiGetAll
[PASSED]: TestContainerApiGetExport
[PASSED]: TestContainerApiGetChanges
[PASSED]: TestContainerApiStartVolumeBinds
[PASSED]: TestContainerApiStartDupVolumeBinds
or even:
View gist:4015fb145c98162f6556
$ wget -O-
--2015-03-31 11:29:04--
Resolving (
Connecting to (||:443... connected.
ERROR: cannot verify's certificate, issued by '/C=US/O=GeoTrust Inc./CN=RapidSSL SHA256 CA - G3':
Unable to locally verify the issuer's authority.
View gist:7ac851fa1a3ac9abd421