Skip to content

Instantly share code, notes, and snippets.

FROM ubuntu
ENV foo=bar
RUN asdasd || echo hi
RUN 123
$ docker build . > out 2> err
$ cat out
Sending build context to Docker daemon 40.09 MB
tl;dr:
- Each unique error message that flows on the wire should use the error processing package.
- This means each unique error message will have a unique ID associated with it.
- Errors generated by libraries, non-Docker-specific code or that are not seen on the wire
can/should continue to use the standard go-lang error mechanisms.
Meaning: strings, types, etc... e.g. https://golang.org/src/os/file.go - line 84
- Each error, defined using the error processing package, will be self-describing. Which includes:
- unique ID
- error text
- descriptive text
Usage: docker [OPTIONS] COMMAND [arg...]
docker daemon [arg...]
docker [ -h | --help | -v | --version ]
A self-sufficient runtime for containers.
Options:
--config=~/.docker Location of client config files
-D, --debug=false Enable debug mode
-H, --host=[] Daemon socket(s) to connect to
@duglin
duglin / gist:a1a139791972e4cad37c
Last active August 29, 2015 14:22
Docker Deprecation Policy
PR Branch: https://github.com/duglin/docker/tree/Deprecate
Right now Docker's development is a bit constrained by the requirement to be backwards compatible.
Normally minor releases (e.g. 1.2 -> 1.3) are required to be backwards compatible, and that makes
a lot of sense for stable products that have a regular major release update schedule.
However, Docker is still (relatively) new and as such some of the original design decisions are
no longer correct, but we are forced to support them for, what feels like, forever. In addition,
there are cases where we decline to offer a better alternative because we would then feel
compelled to support both forever - and usually having more than one way to do something is bad.
In container:
/tmp/f1
/tmp/f2
/tmp/dir/f1
/tmp/dir/f2
CMD: docker cp container:source target
Source Target Body (tar unless otherwise indicated) Stat Hdr Result
/tmp . tmp + tmp/f1, tmp/f2, tmp/dir/f1, tmp/dir/f2 tmp stat ./tmp/...
package main
import (
"fmt"
)
type ErrorCode struct {
code int
next *ErrorCode
}
func GetTimestamp(value string) string {
format := RFC3339NanoFixed
loc := time.FixedZone(time.Now().Zone())
if len(value) < len(format) {
format = format[:len(value)]
}
var shift time.Duration
if i := strings.Index(value, "Z"); i > 0 && i != len(value)-1 {
parts := strings.SplitN(value[i+1:], ":", 2)
@duglin
duglin / findCommon
Created May 7, 2015 14:21
findCommon
package main
import (
"fmt"
"path/filepath"
"strings"
)
func findCommon(paths []string) string {
sep := string(filepath.Separator)
tomcat
tomcat:latest
tomcat:8
tomcat:8-jre7
https://registry.hub.docker.com/_/tomcat/
tomcat-ppc64le
tomcat-ppc64le:latest
tomcat-ppc64le:8
$ wget -O- https://get.docker.com/
--2015-03-31 11:29:04-- https://get.docker.com/
Resolving get.docker.com (get.docker.com)... 162.242.195.82
Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected.
ERROR: cannot verify get.docker.com's certificate, issued by '/C=US/O=GeoTrust Inc./CN=RapidSSL SHA256 CA - G3':
Unable to locally verify the issuer's authority.