From b69893eb6d6f8f54939dbf2ed122ffadbf899dea Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 16:53:54 +0100 Subject: [PATCH 01/55] Clean up proxy Makefile Model for the others, make sure dependencies are correct and that only the exactly correct things are passed to Docker. No longer copy vendor directory. Signed-off-by: Justin Cormack --- alpine/Dockerfile | 4 ++-- alpine/packages/Makefile | 2 +- alpine/packages/proxy/.gitignore | 4 ++-- alpine/packages/proxy/Dockerfile | 5 +---- alpine/packages/proxy/Makefile | 21 +++++++++++---------- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index f120e33f8..21103cb75 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -16,8 +16,8 @@ COPY kernel/$ARCH/kernel-source-info /etc/ ADD kernel/$ARCH/kernel-patches.tar /etc/kernel-patches ADD kernel/$ARCH/kernel-modules.tar / -COPY packages/proxy/slirp-proxy /usr/bin/ -COPY packages/proxy/slirp-proxy /sbin/proxy-vsockd +COPY packages/proxy/proxy /usr/bin/slirp-proxy +COPY packages/proxy/proxy /sbin/proxy-vsockd COPY packages/proxy/etc /etc/ COPY packages/transfused/transfused /sbin/ COPY packages/transfused/etc /etc/ diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 2f5d0ce44..580ba5bd5 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -1,5 +1,5 @@ all: - $(MAKE) -C proxy OS=linux + $(MAKE) -C proxy $(MAKE) -C diagnostics OS=linux $(MAKE) -C transfused OS=linux $(MAKE) -C tap-vsockd OS=linux diff --git a/alpine/packages/proxy/.gitignore b/alpine/packages/proxy/.gitignore index e02fc7aa4..20e175582 100644 --- a/alpine/packages/proxy/.gitignore +++ b/alpine/packages/proxy/.gitignore @@ -1,2 +1,2 @@ -/slirp-proxy -/vendor +proxy +files diff --git a/alpine/packages/proxy/Dockerfile b/alpine/packages/proxy/Dockerfile index e3d93098f..9e8835d6c 100644 --- a/alpine/packages/proxy/Dockerfile +++ b/alpine/packages/proxy/Dockerfile @@ -5,9 +5,6 @@ WORKDIR /go/src/proxy COPY ./ /go/src/proxy/ -ARG GOARCH -ARG GOOS - RUN go install --ldflags '-extldflags "-fno-PIC"' -RUN [ -f /go/bin/*/proxy ] && mv /go/bin/*/proxy /go/bin/ || true +CMD ["tar", "cf", "-", "-C", "/go/bin", "proxy"] diff --git a/alpine/packages/proxy/Makefile b/alpine/packages/proxy/Makefile index 98dabb38d..8211d14cb 100644 --- a/alpine/packages/proxy/Makefile +++ b/alpine/packages/proxy/Makefile @@ -1,15 +1,16 @@ all: proxy -.PHONY: vendor -vendor: - mkdir -p ./vendor - cp -r ../go/vendor/* ./vendor/ +files: + ls Dockerfile *.go > files + find libproxy >> files + printf -- '-C\n../go\n' >> files + (cd ../go && find vendor) >> files -proxy: Dockerfile main.go proxy.go vendor - docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t proxy:build . - docker run --rm proxy:build cat /go/bin/proxy > slirp-proxy - chmod 755 slirp-proxy +proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../go/vendor/manifest files + tar cf - -T files | docker build -t proxy:build - + docker run --rm proxy:build | tar xf - clean: - rm -rf slirp-proxy vendor - docker images -q proxy:build | xargs docker rmi -f || true + rm -rf proxy files + +.DELETE_ON_ERROR: From b3804fd8d4de2f8bd1534b3dc8245fd076a85386 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:14:54 +0100 Subject: [PATCH 02/55] remove obsolete readme Signed-off-by: Justin Cormack --- alpine/packages/README.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 alpine/packages/README.md diff --git a/alpine/packages/README.md b/alpine/packages/README.md deleted file mode 100644 index 92ab2d819..000000000 --- a/alpine/packages/README.md +++ /dev/null @@ -1,3 +0,0 @@ -The directories below should be turned into proper packages, built from upstream. - -Currently these are temporarily vendored from pinata. From 01ad4e5e397868c447014c680ef6bbb4ab621f76 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:15:37 +0100 Subject: [PATCH 03/55] remove arm build code, needs reworking Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 580ba5bd5..a0cea13b5 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -10,11 +10,6 @@ all: $(MAKE) -C 9pmount-vsock OS=linux $(MAKE) -C iptables OS=linux -arm: - $(MAKE) -C docker arm OS=Linux ARCH=arm - # Not cross building at present (C code) - # $(MAKE) -C diagnostics OS=linux ARCH=arm - clean: $(MAKE) -C proxy clean $(MAKE) -C diagnostics clean From 28afc72a97cf90bac0d0c86cf9dc0a2a83718303 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:20:32 +0100 Subject: [PATCH 04/55] move vendor directory directly under packages Signed-off-by: Justin Cormack --- alpine/packages/diagnostics/Makefile | 2 +- alpine/packages/proxy/Makefile | 6 +++--- .../{go => }/vendor/github.com/Sirupsen/logrus/.gitignore | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/.travis.yml | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/CHANGELOG.md | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/LICENSE | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/README.md | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/doc.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/entry.go | 0 .../github.com/Sirupsen/logrus/examples/basic/basic.go | 0 .../vendor/github.com/Sirupsen/logrus/examples/hook/hook.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/exported.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/formatter.go | 0 .../Sirupsen/logrus/formatters/logstash/logstash.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/hooks.go | 0 .../github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go | 0 .../github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go | 0 .../github.com/Sirupsen/logrus/hooks/papertrail/README.md | 0 .../Sirupsen/logrus/hooks/papertrail/papertrail.go | 0 .../github.com/Sirupsen/logrus/hooks/sentry/README.md | 0 .../github.com/Sirupsen/logrus/hooks/sentry/sentry.go | 0 .../github.com/Sirupsen/logrus/hooks/syslog/README.md | 0 .../github.com/Sirupsen/logrus/hooks/syslog/syslog.go | 0 .../vendor/github.com/Sirupsen/logrus/json_formatter.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/logger.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/logrus.go | 0 .../vendor/github.com/Sirupsen/logrus/terminal_bsd.go | 0 .../vendor/github.com/Sirupsen/logrus/terminal_linux.go | 0 .../github.com/Sirupsen/logrus/terminal_notwindows.go | 0 .../vendor/github.com/Sirupsen/logrus/terminal_windows.go | 0 .../vendor/github.com/Sirupsen/logrus/text_formatter.go | 0 .../{go => }/vendor/github.com/Sirupsen/logrus/writer.go | 0 .../{go => }/vendor/github.com/rneugeba/virtsock/go/LICENSE | 0 .../github.com/rneugeba/virtsock/go/examples/client.go | 0 .../github.com/rneugeba/virtsock/go/examples/hvgoecho.go | 0 .../github.com/rneugeba/virtsock/go/examples/hvgostress.go | 0 .../vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock.go | 0 .../github.com/rneugeba/virtsock/go/hvsock/hvsock_darwin.go | 0 .../github.com/rneugeba/virtsock/go/hvsock/hvsock_linux.go | 0 .../rneugeba/virtsock/go/hvsock/hvsock_windows.go | 0 .../rneugeba/virtsock/go/hvsock/zsyscall_windows.go | 0 .../github.com/rneugeba/virtsock/go/vsock/vsock_linux.go | 0 alpine/packages/{go => }/vendor/manifest | 0 alpine/packages/vsudd/Makefile | 2 +- 44 files changed, 5 insertions(+), 5 deletions(-) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/.gitignore (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/.travis.yml (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/CHANGELOG.md (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/LICENSE (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/README.md (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/doc.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/entry.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/exported.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/formatter.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/json_formatter.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/logger.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/logrus.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/terminal_bsd.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/terminal_linux.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/terminal_windows.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/text_formatter.go (100%) rename alpine/packages/{go => }/vendor/github.com/Sirupsen/logrus/writer.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/LICENSE (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/examples/client.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/examples/hvgoecho.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/examples/hvgostress.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_darwin.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_linux.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_windows.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/hvsock/zsyscall_windows.go (100%) rename alpine/packages/{go => }/vendor/github.com/rneugeba/virtsock/go/vsock/vsock_linux.go (100%) rename alpine/packages/{go => }/vendor/manifest (100%) diff --git a/alpine/packages/diagnostics/Makefile b/alpine/packages/diagnostics/Makefile index 19e59e0da..af5b6ea59 100644 --- a/alpine/packages/diagnostics/Makefile +++ b/alpine/packages/diagnostics/Makefile @@ -3,7 +3,7 @@ all: diagnostics-server .PHONY: vendor vendor: mkdir -p ./vendor - cp -r ../go/vendor/* ./vendor/ + cp -r ../vendor/* ./vendor/ diagnostics-server: Dockerfile main.go vendor docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t diagnostics:build . diff --git a/alpine/packages/proxy/Makefile b/alpine/packages/proxy/Makefile index 8211d14cb..cbe7494d9 100644 --- a/alpine/packages/proxy/Makefile +++ b/alpine/packages/proxy/Makefile @@ -3,10 +3,10 @@ all: proxy files: ls Dockerfile *.go > files find libproxy >> files - printf -- '-C\n../go\n' >> files - (cd ../go && find vendor) >> files + printf -- '-C\n..\n' >> files + (cd .. && find vendor) >> files -proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../go/vendor/manifest files +proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../vendor/manifest files tar cf - -T files | docker build -t proxy:build - docker run --rm proxy:build | tar xf - diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/.gitignore b/alpine/packages/vendor/github.com/Sirupsen/logrus/.gitignore similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/.gitignore rename to alpine/packages/vendor/github.com/Sirupsen/logrus/.gitignore diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/.travis.yml b/alpine/packages/vendor/github.com/Sirupsen/logrus/.travis.yml similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/.travis.yml rename to alpine/packages/vendor/github.com/Sirupsen/logrus/.travis.yml diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/CHANGELOG.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/CHANGELOG.md similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/CHANGELOG.md rename to alpine/packages/vendor/github.com/Sirupsen/logrus/CHANGELOG.md diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/LICENSE b/alpine/packages/vendor/github.com/Sirupsen/logrus/LICENSE similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/LICENSE rename to alpine/packages/vendor/github.com/Sirupsen/logrus/LICENSE diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/README.md similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/README.md rename to alpine/packages/vendor/github.com/Sirupsen/logrus/README.md diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/doc.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/doc.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/doc.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/doc.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/entry.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/entry.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/entry.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/entry.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/exported.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/exported.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/exported.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/exported.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/formatter.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/formatter.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/formatter.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/formatter.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/json_formatter.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/json_formatter.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/json_formatter.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/json_formatter.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/logger.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/logger.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/logger.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/logger.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/logrus.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/logrus.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/logrus.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/logrus.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_bsd.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_bsd.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_bsd.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_bsd.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_linux.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_linux.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_linux.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_windows.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/terminal_windows.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_windows.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/text_formatter.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/text_formatter.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/text_formatter.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/text_formatter.go diff --git a/alpine/packages/go/vendor/github.com/Sirupsen/logrus/writer.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/writer.go similarity index 100% rename from alpine/packages/go/vendor/github.com/Sirupsen/logrus/writer.go rename to alpine/packages/vendor/github.com/Sirupsen/logrus/writer.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/LICENSE b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/LICENSE similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/LICENSE rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/LICENSE diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/examples/client.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/examples/client.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/examples/client.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/examples/client.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/examples/hvgoecho.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/examples/hvgoecho.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/examples/hvgoecho.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/examples/hvgoecho.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/examples/hvgostress.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/examples/hvgostress.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/examples/hvgostress.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/examples/hvgostress.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_darwin.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_darwin.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_darwin.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_darwin.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_linux.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_linux.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_linux.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_linux.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_windows.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_windows.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_windows.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/hvsock_windows.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/zsyscall_windows.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/zsyscall_windows.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/hvsock/zsyscall_windows.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/hvsock/zsyscall_windows.go diff --git a/alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/vsock/vsock_linux.go b/alpine/packages/vendor/github.com/rneugeba/virtsock/go/vsock/vsock_linux.go similarity index 100% rename from alpine/packages/go/vendor/github.com/rneugeba/virtsock/go/vsock/vsock_linux.go rename to alpine/packages/vendor/github.com/rneugeba/virtsock/go/vsock/vsock_linux.go diff --git a/alpine/packages/go/vendor/manifest b/alpine/packages/vendor/manifest similarity index 100% rename from alpine/packages/go/vendor/manifest rename to alpine/packages/vendor/manifest diff --git a/alpine/packages/vsudd/Makefile b/alpine/packages/vsudd/Makefile index 80f1e5578..1a40be85b 100644 --- a/alpine/packages/vsudd/Makefile +++ b/alpine/packages/vsudd/Makefile @@ -3,7 +3,7 @@ all: vsudd .PHONY: vendor vendor: mkdir -p ./vendor - cp -r ../go/vendor/* ./vendor/ + cp -r ../vendor/* ./vendor/ vsudd: Dockerfile main.go vendor docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t vsudd:build . From d0c3e873f6f047ac49bc0a837ef2d4ea0e2ceb5e Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:28:08 +0100 Subject: [PATCH 05/55] Do not need to use logrus, not using any features of it here. Signed-off-by: Justin Cormack --- alpine/packages/proxy/libproxy/tcp_proxy.go | 13 +- .../proxy/libproxy/udp_encapsulation.go | 5 +- alpine/packages/proxy/libproxy/udp_proxy.go | 9 +- .../github.com/Sirupsen/logrus/.gitignore | 1 - .../github.com/Sirupsen/logrus/.travis.yml | 8 - .../github.com/Sirupsen/logrus/CHANGELOG.md | 47 --- .../vendor/github.com/Sirupsen/logrus/LICENSE | 21 -- .../github.com/Sirupsen/logrus/README.md | 357 ------------------ .../vendor/github.com/Sirupsen/logrus/doc.go | 26 -- .../github.com/Sirupsen/logrus/entry.go | 264 ------------- .../Sirupsen/logrus/examples/basic/basic.go | 50 --- .../Sirupsen/logrus/examples/hook/hook.go | 30 -- .../github.com/Sirupsen/logrus/exported.go | 193 ---------- .../github.com/Sirupsen/logrus/formatter.go | 48 --- .../logrus/formatters/logstash/logstash.go | 56 --- .../github.com/Sirupsen/logrus/hooks.go | 34 -- .../logrus/hooks/airbrake/airbrake.go | 54 --- .../Sirupsen/logrus/hooks/bugsnag/bugsnag.go | 68 ---- .../logrus/hooks/papertrail/README.md | 28 -- .../logrus/hooks/papertrail/papertrail.go | 55 --- .../Sirupsen/logrus/hooks/sentry/README.md | 111 ------ .../Sirupsen/logrus/hooks/sentry/sentry.go | 137 ------- .../Sirupsen/logrus/hooks/syslog/README.md | 20 - .../Sirupsen/logrus/hooks/syslog/syslog.go | 59 --- .../Sirupsen/logrus/json_formatter.go | 41 -- .../github.com/Sirupsen/logrus/logger.go | 206 ---------- .../github.com/Sirupsen/logrus/logrus.go | 98 ----- .../Sirupsen/logrus/terminal_bsd.go | 9 - .../Sirupsen/logrus/terminal_linux.go | 12 - .../Sirupsen/logrus/terminal_notwindows.go | 21 -- .../Sirupsen/logrus/terminal_windows.go | 27 -- .../Sirupsen/logrus/text_formatter.go | 159 -------- .../github.com/Sirupsen/logrus/writer.go | 31 -- alpine/packages/vendor/manifest | 2 +- 34 files changed, 13 insertions(+), 2287 deletions(-) delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/.gitignore delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/.travis.yml delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/CHANGELOG.md delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/LICENSE delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/README.md delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/doc.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/entry.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/exported.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/formatter.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/json_formatter.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/logger.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/logrus.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_bsd.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_linux.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_windows.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/text_formatter.go delete mode 100644 alpine/packages/vendor/github.com/Sirupsen/logrus/writer.go diff --git a/alpine/packages/proxy/libproxy/tcp_proxy.go b/alpine/packages/proxy/libproxy/tcp_proxy.go index 758918ed4..ed177df92 100644 --- a/alpine/packages/proxy/libproxy/tcp_proxy.go +++ b/alpine/packages/proxy/libproxy/tcp_proxy.go @@ -2,9 +2,8 @@ package libproxy import ( "io" + "log" "net" - - "github.com/Sirupsen/logrus" ) type Conn interface { @@ -37,7 +36,7 @@ func NewTCPProxy(listener net.Listener, backendAddr *net.TCPAddr) (*TCPProxy, er func HandleTCPConnection(client Conn, backendAddr *net.TCPAddr, quit chan bool) { backend, err := net.DialTCP("tcp", nil, backendAddr) if err != nil { - logrus.Printf("Can't forward traffic to backend tcp/%v: %s\n", backendAddr, err) + log.Printf("Can't forward traffic to backend tcp/%v: %s\n", backendAddr, err) client.Close() return } @@ -46,15 +45,15 @@ func HandleTCPConnection(client Conn, backendAddr *net.TCPAddr, quit chan bool) var broker = func(to, from Conn) { written, err := io.Copy(to, from) if err != nil { - logrus.Println("error copying:", err) + log.Println("error copying:", err) } err = from.CloseRead() if err != nil { - logrus.Println("error CloseRead from:", err) + log.Println("error CloseRead from:", err) } err = to.CloseWrite() if err != nil { - logrus.Println("error CloseWrite to:", err) + log.Println("error CloseWrite to:", err) } event <- written } @@ -88,7 +87,7 @@ func (proxy *TCPProxy) Run() { for { client, err := proxy.listener.Accept() if err != nil { - logrus.Printf("Stopping proxy on tcp/%v for tcp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err) + log.Printf("Stopping proxy on tcp/%v for tcp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err) return } go HandleTCPConnection(client.(Conn), proxy.backendAddr, quit) diff --git a/alpine/packages/proxy/libproxy/udp_encapsulation.go b/alpine/packages/proxy/libproxy/udp_encapsulation.go index c3daf4997..244f73169 100644 --- a/alpine/packages/proxy/libproxy/udp_encapsulation.go +++ b/alpine/packages/proxy/libproxy/udp_encapsulation.go @@ -4,10 +4,9 @@ import ( "bytes" "encoding/binary" "io" + "log" "net" "sync" - - "github.com/Sirupsen/logrus" ) type udpListener interface { @@ -32,7 +31,7 @@ func (u *udpEncapsulator) getConn() (net.Conn, error) { } conn, err := u.listener.Accept() if err != nil { - logrus.Printf("Failed to accept connection: %#v", err) + log.Printf("Failed to accept connection: %#v", err) return nil, err } u.conn = &conn diff --git a/alpine/packages/proxy/libproxy/udp_proxy.go b/alpine/packages/proxy/libproxy/udp_proxy.go index 3e5a971c6..ed3ccba1f 100644 --- a/alpine/packages/proxy/libproxy/udp_proxy.go +++ b/alpine/packages/proxy/libproxy/udp_proxy.go @@ -2,13 +2,12 @@ package libproxy import ( "encoding/binary" + "log" "net" "strings" "sync" "syscall" "time" - - "github.com/Sirupsen/logrus" ) const ( @@ -109,7 +108,7 @@ func (proxy *UDPProxy) Run() { // ECONNREFUSED like Read do (see comment in // UDPProxy.replyLoop) if !isClosedError(err) { - logrus.Printf("Stopping proxy on %v for udp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err) + log.Printf("Stopping proxy on %v for udp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err) } break } @@ -120,7 +119,7 @@ func (proxy *UDPProxy) Run() { if !hit { proxyConn, err = net.DialUDP("udp", nil, proxy.backendAddr) if err != nil { - logrus.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err) + log.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err) proxy.connTrackLock.Unlock() continue } @@ -131,7 +130,7 @@ func (proxy *UDPProxy) Run() { for i := 0; i != read; { written, err := proxyConn.Write(readBuf[i:read]) if err != nil { - logrus.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err) + log.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err) break } i += written diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/.gitignore b/alpine/packages/vendor/github.com/Sirupsen/logrus/.gitignore deleted file mode 100644 index 66be63a00..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/.gitignore +++ /dev/null @@ -1 +0,0 @@ -logrus diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/.travis.yml b/alpine/packages/vendor/github.com/Sirupsen/logrus/.travis.yml deleted file mode 100644 index 2d8c08661..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go -go: - - 1.2 - - 1.3 - - 1.4 - - tip -install: - - go get -t ./... diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/CHANGELOG.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/CHANGELOG.md deleted file mode 100644 index 78f98959b..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/CHANGELOG.md +++ /dev/null @@ -1,47 +0,0 @@ -# 0.8.7 - -* logrus/core: fix possible race (#216) -* logrus/doc: small typo fixes and doc improvements - - -# 0.8.6 - -* hooks/raven: allow passing an initialized client - -# 0.8.5 - -* logrus/core: revert #208 - -# 0.8.4 - -* formatter/text: fix data race (#218) - -# 0.8.3 - -* logrus/core: fix entry log level (#208) -* logrus/core: improve performance of text formatter by 40% -* logrus/core: expose `LevelHooks` type -* logrus/core: add support for DragonflyBSD and NetBSD -* formatter/text: print structs more verbosely - -# 0.8.2 - -* logrus: fix more Fatal family functions - -# 0.8.1 - -* logrus: fix not exiting on `Fatalf` and `Fatalln` - -# 0.8.0 - -* logrus: defaults to stderr instead of stdout -* hooks/sentry: add special field for `*http.Request` -* formatter/text: ignore Windows for colors - -# 0.7.3 - -* formatter/\*: allow configuration of timestamp layout - -# 0.7.2 - -* formatter/text: Add configuration option for time format (#158) diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/LICENSE b/alpine/packages/vendor/github.com/Sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb42f..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/README.md deleted file mode 100644 index 6fa6e2062..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/README.md +++ /dev/null @@ -1,357 +0,0 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/Sirupsen/logrus.svg?branch=master)](https://travis-ci.org/Sirupsen/logrus) [![godoc reference](https://godoc.org/github.com/Sirupsen/logrus?status.png)][godoc] - -Logrus is a structured logger for Go (golang), completely API compatible with -the standard library logger. [Godoc][godoc]. **Please note the Logrus API is not -yet stable (pre 1.0). Logrus itself is completely stable and has been used in -many large deployments. The core API is unlikely to change much but please -version control your Logrus to make sure you aren't fetching latest `master` on -every build.** - -Nicely color-coded in development (when a TTY is attached, otherwise just -plain text): - -![Colored](http://i.imgur.com/PY7qMwd.png) - -With `log.Formatter = new(logrus.JSONFormatter)`, for easy parsing by logstash -or Splunk: - -```json -{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the -ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} - -{"level":"warning","msg":"The group's number increased tremendously!", -"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"A giant walrus appears!", -"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", -"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} - -{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, -"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} -``` - -With the default `log.Formatter = new(&log.TextFormatter{})` when a TTY is not -attached, the output is compatible with the -[logfmt](http://godoc.org/github.com/kr/logfmt) format: - -```text -time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 -time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 -time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true -time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 -time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 -time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true -exit status 1 -``` - -#### Example - -The simplest way to use Logrus is simply the package-level exported logger: - -```go -package main - -import ( - log "github.com/Sirupsen/logrus" -) - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - }).Info("A walrus appears") -} -``` - -Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/Sirupsen/logrus"` -and you'll now have the flexibility of Logrus. You can customize it all you -want: - -```go -package main - -import ( - "os" - log "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/airbrake" -) - -func init() { - // Log as JSON instead of the default ASCII formatter. - log.SetFormatter(&log.JSONFormatter{}) - - // Use the Airbrake hook to report errors that have Error severity or above to - // an exception tracker. You can create custom hooks, see the Hooks section. - log.AddHook(airbrake.NewHook("https://example.com", "xyz", "development")) - - // Output to stderr instead of stdout, could also be a file. - log.SetOutput(os.Stderr) - - // Only log the warning severity or above. - log.SetLevel(log.WarnLevel) -} - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(log.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(log.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") - - // A common pattern is to re-use fields between logging statements by re-using - // the logrus.Entry returned from WithFields() - contextLogger := log.WithFields(log.Fields{ - "common": "this is a common field", - "other": "I also should be logged always", - }) - - contextLogger.Info("I'll be logged with common and other field") - contextLogger.Info("Me too") -} -``` - -For more advanced usage such as logging to multiple locations from the same -application, you can also create an instance of the `logrus` Logger: - -```go -package main - -import ( - "github.com/Sirupsen/logrus" -) - -// Create a new instance of the logger. You can have any number of instances. -var log = logrus.New() - -func main() { - // The API for setting attributes is a little different than the package level - // exported logger. See Godoc. - log.Out = os.Stderr - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") -} -``` - -#### Fields - -Logrus encourages careful, structured logging though logging fields instead of -long, unparseable error messages. For example, instead of: `log.Fatalf("Failed -to send event %s to topic %s with key %d")`, you should log the much more -discoverable: - -```go -log.WithFields(log.Fields{ - "event": event, - "topic": topic, - "key": key, -}).Fatal("Failed to send event") -``` - -We've found this API forces you to think about logging in a way that produces -much more useful logging messages. We've been in countless situations where just -a single added field to a log statement that was already there would've saved us -hours. The `WithFields` call is optional. - -In general, with Logrus using any of the `printf`-family functions should be -seen as a hint you should add a field, however, you can still use the -`printf`-family functions with Logrus. - -#### Hooks - -You can add hooks for logging levels. For example to send errors to an exception -tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to -multiple places simultaneously, e.g. syslog. - -Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in -`init`: - -```go -import ( - log "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/airbrake" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" - "log/syslog" -) - -func init() { - log.AddHook(airbrake.NewHook("https://example.com", "xyz", "development")) - - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - if err != nil { - log.Error("Unable to connect to local syslog daemon") - } else { - log.AddHook(hook) - } -} -``` - - -| Hook | Description | -| ----- | ----------- | -| [Airbrake](https://github.com/Sirupsen/logrus/blob/master/hooks/airbrake/airbrake.go) | Send errors to an exception tracking service compatible with the Airbrake API. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. | -| [Papertrail](https://github.com/Sirupsen/logrus/blob/master/hooks/papertrail/papertrail.go) | Send errors to the Papertrail hosted logging service via UDP. | -| [Syslog](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. | -| [BugSnag](https://github.com/Sirupsen/logrus/blob/master/hooks/bugsnag/bugsnag.go) | Send errors to the Bugsnag exception tracking service. | -| [Sentry](https://github.com/Sirupsen/logrus/blob/master/hooks/sentry/sentry.go) | Send errors to the Sentry error logging and aggregation service. | -| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. | -| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) | -| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. | -| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` | -| [Graylog](https://github.com/gemnasium/logrus-hooks/tree/master/graylog) | Hook for logging to [Graylog](http://graylog2.org/) | -| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) | -| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem | -| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger | -| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail | -| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar | -| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd | -| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb | - -#### Level logging - -Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic. - -```go -log.Debug("Useful debugging information.") -log.Info("Something noteworthy happened!") -log.Warn("You should probably take a look at this.") -log.Error("Something failed but I'm not quitting.") -// Calls os.Exit(1) after logging -log.Fatal("Bye.") -// Calls panic() after logging -log.Panic("I'm bailing.") -``` - -You can set the logging level on a `Logger`, then it will only log entries with -that severity or anything above it: - -```go -// Will log anything that is info or above (warn, error, fatal, panic). Default. -log.SetLevel(log.InfoLevel) -``` - -It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose -environment if your application has that. - -#### Entries - -Besides the fields added with `WithField` or `WithFields` some fields are -automatically added to all logging events: - -1. `time`. The timestamp when the entry was created. -2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after - the `AddFields` call. E.g. `Failed to send event.` -3. `level`. The logging level. E.g. `info`. - -#### Environments - -Logrus has no notion of environment. - -If you wish for hooks and formatters to only be used in specific environments, -you should handle that yourself. For example, if your application has a global -variable `Environment`, which is a string representation of the environment you -could do: - -```go -import ( - log "github.com/Sirupsen/logrus" -) - -init() { - // do something here to set environment depending on an environment variable - // or command-line flag - if Environment == "production" { - log.SetFormatter(&log.JSONFormatter{}) - } else { - // The TextFormatter is default, you don't actually have to do this. - log.SetFormatter(&log.TextFormatter{}) - } -} -``` - -This configuration is how `logrus` was intended to be used, but JSON in -production is mostly only useful if you do log aggregation with tools like -Splunk or Logstash. - -#### Formatters - -The built-in logging formatters are: - -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise - without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` - field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true` -* `logrus.JSONFormatter`. Logs fields as JSON. -* `logrus_logstash.LogstashFormatter`. Logs fields as Logstash Events (http://logstash.net). - - ```go - logrus.SetFormatter(&logrus_logstash.LogstashFormatter{Type: “application_name"}) - ``` - -Third party logging formatters: - -* [`zalgo`](https://github.com/aybabtme/logzalgo): invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. - -You can define your formatter by implementing the `Formatter` interface, -requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a -`Fields` type (`map[string]interface{}`) with all your fields as well as the -default ones (see Entries section above): - -```go -type MyJSONFormatter struct { -} - -log.SetFormatter(new(MyJSONFormatter)) - -func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { - // Note this doesn't include Time, Level and Message which are available on - // the Entry. Consult `godoc` on information about those fields or read the - // source of the official loggers. - serialized, err := json.Marshal(entry.Data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} -``` - -#### Logger as an `io.Writer` - -Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. - -```go -w := logger.Writer() -defer w.Close() - -srv := http.Server{ - // create a stdlib log.Logger that writes to - // logrus.Logger. - ErrorLog: log.New(w, "", 0), -} -``` - -Each line written to that writer will be printed the usual way, using formatters -and hooks. The level for those entries is `info`. - -#### Rotation - -Log rotation is not provided with Logrus. Log rotation should be done by an -external program (like `logrotate(8)`) that can compress and delete old log -entries. It should not be a feature of the application-level logger. - - -[godoc]: https://godoc.org/github.com/Sirupsen/logrus diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/doc.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/doc.go deleted file mode 100644 index dddd5f877..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Package logrus is a structured logger for Go, completely API compatible with the standard library logger. - - -The simplest way to use Logrus is simply the package-level exported logger: - - package main - - import ( - log "github.com/Sirupsen/logrus" - ) - - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } - -Output: - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 - -For a full guide visit https://github.com/Sirupsen/logrus -*/ -package logrus diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/entry.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/entry.go deleted file mode 100644 index 9ae900bc5..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/entry.go +++ /dev/null @@ -1,264 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "io" - "os" - "time" -) - -// Defines the key when adding errors using WithError. -var ErrorKey = "error" - -// An entry is the final or intermediate Logrus logging entry. It contains all -// the fields passed with WithField{,s}. It's finally logged when Debug, Info, -// Warn, Error, Fatal or Panic is called on it. These objects can be reused and -// passed around as much as you wish to avoid field duplication. -type Entry struct { - Logger *Logger - - // Contains all the fields set by the user. - Data Fields - - // Time at which the log entry was created - Time time.Time - - // Level the log entry was logged at: Debug, Info, Warn, Error, Fatal or Panic - Level Level - - // Message passed to Debug, Info, Warn, Error, Fatal or Panic - Message string -} - -func NewEntry(logger *Logger) *Entry { - return &Entry{ - Logger: logger, - // Default is three fields, give a little extra room - Data: make(Fields, 5), - } -} - -// Returns a reader for the entry, which is a proxy to the formatter. -func (entry *Entry) Reader() (*bytes.Buffer, error) { - serialized, err := entry.Logger.Formatter.Format(entry) - return bytes.NewBuffer(serialized), err -} - -// Returns the string representation from the reader and ultimately the -// formatter. -func (entry *Entry) String() (string, error) { - reader, err := entry.Reader() - if err != nil { - return "", err - } - - return reader.String(), err -} - -// Add an error as single field (using the key defined in ErrorKey) to the Entry. -func (entry *Entry) WithError(err error) *Entry { - return entry.WithField(ErrorKey, err) -} - -// Add a single field to the Entry. -func (entry *Entry) WithField(key string, value interface{}) *Entry { - return entry.WithFields(Fields{key: value}) -} - -// Add a map of fields to the Entry. -func (entry *Entry) WithFields(fields Fields) *Entry { - data := Fields{} - for k, v := range entry.Data { - data[k] = v - } - for k, v := range fields { - data[k] = v - } - return &Entry{Logger: entry.Logger, Data: data} -} - -// This function is not declared with a pointer value because otherwise -// race conditions will occur when using multiple goroutines -func (entry Entry) log(level Level, msg string) { - entry.Time = time.Now() - entry.Level = level - entry.Message = msg - - if err := entry.Logger.Hooks.Fire(level, &entry); err != nil { - entry.Logger.mu.Lock() - fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) - entry.Logger.mu.Unlock() - } - - reader, err := entry.Reader() - if err != nil { - entry.Logger.mu.Lock() - fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) - entry.Logger.mu.Unlock() - } - - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - - _, err = io.Copy(entry.Logger.Out, reader) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) - } - - // To avoid Entry#log() returning a value that only would make sense for - // panic() to use in Entry#Panic(), we avoid the allocation by checking - // directly here. - if level <= PanicLevel { - panic(&entry) - } -} - -func (entry *Entry) Debug(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.log(DebugLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Print(args ...interface{}) { - entry.Info(args...) -} - -func (entry *Entry) Info(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.log(InfoLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warn(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.log(WarnLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warning(args ...interface{}) { - entry.Warn(args...) -} - -func (entry *Entry) Error(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.log(ErrorLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Fatal(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.log(FatalLevel, fmt.Sprint(args...)) - } - os.Exit(1) -} - -func (entry *Entry) Panic(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.log(PanicLevel, fmt.Sprint(args...)) - } - panic(fmt.Sprint(args...)) -} - -// Entry Printf family functions - -func (entry *Entry) Debugf(format string, args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.Debug(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Infof(format string, args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.Info(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Printf(format string, args ...interface{}) { - entry.Infof(format, args...) -} - -func (entry *Entry) Warnf(format string, args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.Warn(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Warningf(format string, args ...interface{}) { - entry.Warnf(format, args...) -} - -func (entry *Entry) Errorf(format string, args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.Error(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Fatalf(format string, args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.Fatal(fmt.Sprintf(format, args...)) - } - os.Exit(1) -} - -func (entry *Entry) Panicf(format string, args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.Panic(fmt.Sprintf(format, args...)) - } -} - -// Entry Println family functions - -func (entry *Entry) Debugln(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.Debug(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Infoln(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.Info(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Println(args ...interface{}) { - entry.Infoln(args...) -} - -func (entry *Entry) Warnln(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.Warn(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Warningln(args ...interface{}) { - entry.Warnln(args...) -} - -func (entry *Entry) Errorln(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.Error(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Fatalln(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.Fatal(entry.sprintlnn(args...)) - } - os.Exit(1) -} - -func (entry *Entry) Panicln(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.Panic(entry.sprintlnn(args...)) - } -} - -// Sprintlnn => Sprint no newline. This is to get the behavior of how -// fmt.Sprintln where spaces are always added between operands, regardless of -// their type. Instead of vendoring the Sprintln implementation to spare a -// string allocation, we do the simplest thing. -func (entry *Entry) sprintlnn(args ...interface{}) string { - msg := fmt.Sprintln(args...) - return msg[:len(msg)-1] -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go deleted file mode 100644 index a1623ec00..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "github.com/Sirupsen/logrus" -) - -var log = logrus.New() - -func init() { - log.Formatter = new(logrus.JSONFormatter) - log.Formatter = new(logrus.TextFormatter) // default - log.Level = logrus.DebugLevel -} - -func main() { - defer func() { - err := recover() - if err != nil { - log.WithFields(logrus.Fields{ - "omg": true, - "err": err, - "number": 100, - }).Fatal("The ice breaks!") - } - }() - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "number": 8, - }).Debug("Started observing beach") - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(logrus.Fields{ - "temperature": -4, - }).Debug("Temperature changes") - - log.WithFields(logrus.Fields{ - "animal": "orca", - "size": 9009, - }).Panic("It's over 9000!") -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go deleted file mode 100644 index cb5759a35..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/airbrake" -) - -var log = logrus.New() - -func init() { - log.Formatter = new(logrus.TextFormatter) // default - log.Hooks.Add(airbrake.NewHook("https://example.com", "xyz", "development")) -} - -func main() { - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/exported.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/exported.go deleted file mode 100644 index 9a0120ac1..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/exported.go +++ /dev/null @@ -1,193 +0,0 @@ -package logrus - -import ( - "io" -) - -var ( - // std is the name of the standard logger in stdlib `log` - std = New() -) - -func StandardLogger() *Logger { - return std -} - -// SetOutput sets the standard logger output. -func SetOutput(out io.Writer) { - std.mu.Lock() - defer std.mu.Unlock() - std.Out = out -} - -// SetFormatter sets the standard logger formatter. -func SetFormatter(formatter Formatter) { - std.mu.Lock() - defer std.mu.Unlock() - std.Formatter = formatter -} - -// SetLevel sets the standard logger level. -func SetLevel(level Level) { - std.mu.Lock() - defer std.mu.Unlock() - std.Level = level -} - -// GetLevel returns the standard logger level. -func GetLevel() Level { - std.mu.Lock() - defer std.mu.Unlock() - return std.Level -} - -// AddHook adds a hook to the standard logger hooks. -func AddHook(hook Hook) { - std.mu.Lock() - defer std.mu.Unlock() - std.Hooks.Add(hook) -} - -// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key. -func WithError(err error) *Entry { - return std.WithField(ErrorKey, err) -} - -// WithField creates an entry from the standard logger and adds a field to -// it. If you want multiple fields, use `WithFields`. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithField(key string, value interface{}) *Entry { - return std.WithField(key, value) -} - -// WithFields creates an entry from the standard logger and adds multiple -// fields to it. This is simply a helper for `WithField`, invoking it -// once for each field. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithFields(fields Fields) *Entry { - return std.WithFields(fields) -} - -// Debug logs a message at level Debug on the standard logger. -func Debug(args ...interface{}) { - std.Debug(args...) -} - -// Print logs a message at level Info on the standard logger. -func Print(args ...interface{}) { - std.Print(args...) -} - -// Info logs a message at level Info on the standard logger. -func Info(args ...interface{}) { - std.Info(args...) -} - -// Warn logs a message at level Warn on the standard logger. -func Warn(args ...interface{}) { - std.Warn(args...) -} - -// Warning logs a message at level Warn on the standard logger. -func Warning(args ...interface{}) { - std.Warning(args...) -} - -// Error logs a message at level Error on the standard logger. -func Error(args ...interface{}) { - std.Error(args...) -} - -// Panic logs a message at level Panic on the standard logger. -func Panic(args ...interface{}) { - std.Panic(args...) -} - -// Fatal logs a message at level Fatal on the standard logger. -func Fatal(args ...interface{}) { - std.Fatal(args...) -} - -// Debugf logs a message at level Debug on the standard logger. -func Debugf(format string, args ...interface{}) { - std.Debugf(format, args...) -} - -// Printf logs a message at level Info on the standard logger. -func Printf(format string, args ...interface{}) { - std.Printf(format, args...) -} - -// Infof logs a message at level Info on the standard logger. -func Infof(format string, args ...interface{}) { - std.Infof(format, args...) -} - -// Warnf logs a message at level Warn on the standard logger. -func Warnf(format string, args ...interface{}) { - std.Warnf(format, args...) -} - -// Warningf logs a message at level Warn on the standard logger. -func Warningf(format string, args ...interface{}) { - std.Warningf(format, args...) -} - -// Errorf logs a message at level Error on the standard logger. -func Errorf(format string, args ...interface{}) { - std.Errorf(format, args...) -} - -// Panicf logs a message at level Panic on the standard logger. -func Panicf(format string, args ...interface{}) { - std.Panicf(format, args...) -} - -// Fatalf logs a message at level Fatal on the standard logger. -func Fatalf(format string, args ...interface{}) { - std.Fatalf(format, args...) -} - -// Debugln logs a message at level Debug on the standard logger. -func Debugln(args ...interface{}) { - std.Debugln(args...) -} - -// Println logs a message at level Info on the standard logger. -func Println(args ...interface{}) { - std.Println(args...) -} - -// Infoln logs a message at level Info on the standard logger. -func Infoln(args ...interface{}) { - std.Infoln(args...) -} - -// Warnln logs a message at level Warn on the standard logger. -func Warnln(args ...interface{}) { - std.Warnln(args...) -} - -// Warningln logs a message at level Warn on the standard logger. -func Warningln(args ...interface{}) { - std.Warningln(args...) -} - -// Errorln logs a message at level Error on the standard logger. -func Errorln(args ...interface{}) { - std.Errorln(args...) -} - -// Panicln logs a message at level Panic on the standard logger. -func Panicln(args ...interface{}) { - std.Panicln(args...) -} - -// Fatalln logs a message at level Fatal on the standard logger. -func Fatalln(args ...interface{}) { - std.Fatalln(args...) -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/formatter.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/formatter.go deleted file mode 100644 index 104d689f1..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/formatter.go +++ /dev/null @@ -1,48 +0,0 @@ -package logrus - -import "time" - -const DefaultTimestampFormat = time.RFC3339 - -// The Formatter interface is used to implement a custom Formatter. It takes an -// `Entry`. It exposes all the fields, including the default ones: -// -// * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. -// * `entry.Data["time"]`. The timestamp. -// * `entry.Data["level"]. The level the entry was logged at. -// -// Any additional fields added with `WithField` or `WithFields` are also in -// `entry.Data`. Format is expected to return an array of bytes which are then -// logged to `logger.Out`. -type Formatter interface { - Format(*Entry) ([]byte, error) -} - -// This is to not silently overwrite `time`, `msg` and `level` fields when -// dumping it. If this code wasn't there doing: -// -// logrus.WithField("level", 1).Info("hello") -// -// Would just silently drop the user provided level. Instead with this code -// it'll logged as: -// -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} -// -// It's not exported because it's still using Data in an opinionated way. It's to -// avoid code duplication between the two default formatters. -func prefixFieldClashes(data Fields) { - _, ok := data["time"] - if ok { - data["fields.time"] = data["time"] - } - - _, ok = data["msg"] - if ok { - data["fields.msg"] = data["msg"] - } - - _, ok = data["level"] - if ok { - data["fields.level"] = data["level"] - } -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go deleted file mode 100644 index 8ea93ddf2..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/formatters/logstash/logstash.go +++ /dev/null @@ -1,56 +0,0 @@ -package logstash - -import ( - "encoding/json" - "fmt" - - "github.com/Sirupsen/logrus" -) - -// Formatter generates json in logstash format. -// Logstash site: http://logstash.net/ -type LogstashFormatter struct { - Type string // if not empty use for logstash type field. - - // TimestampFormat sets the format used for timestamps. - TimestampFormat string -} - -func (f *LogstashFormatter) Format(entry *logrus.Entry) ([]byte, error) { - entry.Data["@version"] = 1 - - if f.TimestampFormat == "" { - f.TimestampFormat = logrus.DefaultTimestampFormat - } - - entry.Data["@timestamp"] = entry.Time.Format(f.TimestampFormat) - - // set message field - v, ok := entry.Data["message"] - if ok { - entry.Data["fields.message"] = v - } - entry.Data["message"] = entry.Message - - // set level field - v, ok = entry.Data["level"] - if ok { - entry.Data["fields.level"] = v - } - entry.Data["level"] = entry.Level.String() - - // set type field - if f.Type != "" { - v, ok = entry.Data["type"] - if ok { - entry.Data["fields.type"] = v - } - entry.Data["type"] = f.Type - } - - serialized, err := json.Marshal(entry.Data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks.go deleted file mode 100644 index 3f151cdc3..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks.go +++ /dev/null @@ -1,34 +0,0 @@ -package logrus - -// A hook to be fired when logging on the logging levels returned from -// `Levels()` on your implementation of the interface. Note that this is not -// fired in a goroutine or a channel with workers, you should handle such -// functionality yourself if your call is non-blocking and you don't wish for -// the logging calls for levels returned from `Levels()` to block. -type Hook interface { - Levels() []Level - Fire(*Entry) error -} - -// Internal type for storing the hooks on a logger instance. -type LevelHooks map[Level][]Hook - -// Add a hook to an instance of logger. This is called with -// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. -func (hooks LevelHooks) Add(hook Hook) { - for _, level := range hook.Levels() { - hooks[level] = append(hooks[level], hook) - } -} - -// Fire all the hooks for the passed level. Used by `entry.log` to fire -// appropriate hooks for a log entry. -func (hooks LevelHooks) Fire(level Level, entry *Entry) error { - for _, hook := range hooks[level] { - if err := hook.Fire(entry); err != nil { - return err - } - } - - return nil -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go deleted file mode 100644 index b0502c335..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go +++ /dev/null @@ -1,54 +0,0 @@ -package airbrake - -import ( - "errors" - "fmt" - - "github.com/Sirupsen/logrus" - "github.com/tobi/airbrake-go" -) - -// AirbrakeHook to send exceptions to an exception-tracking service compatible -// with the Airbrake API. -type airbrakeHook struct { - APIKey string - Endpoint string - Environment string -} - -func NewHook(endpoint, apiKey, env string) *airbrakeHook { - return &airbrakeHook{ - APIKey: apiKey, - Endpoint: endpoint, - Environment: env, - } -} - -func (hook *airbrakeHook) Fire(entry *logrus.Entry) error { - airbrake.ApiKey = hook.APIKey - airbrake.Endpoint = hook.Endpoint - airbrake.Environment = hook.Environment - - var notifyErr error - err, ok := entry.Data["error"].(error) - if ok { - notifyErr = err - } else { - notifyErr = errors.New(entry.Message) - } - - airErr := airbrake.Notify(notifyErr) - if airErr != nil { - return fmt.Errorf("Failed to send error to Airbrake: %s", airErr) - } - - return nil -} - -func (hook *airbrakeHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.ErrorLevel, - logrus.FatalLevel, - logrus.PanicLevel, - } -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go deleted file mode 100644 index d20a0f54a..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/bugsnag/bugsnag.go +++ /dev/null @@ -1,68 +0,0 @@ -package logrus_bugsnag - -import ( - "errors" - - "github.com/Sirupsen/logrus" - "github.com/bugsnag/bugsnag-go" -) - -type bugsnagHook struct{} - -// ErrBugsnagUnconfigured is returned if NewBugsnagHook is called before -// bugsnag.Configure. Bugsnag must be configured before the hook. -var ErrBugsnagUnconfigured = errors.New("bugsnag must be configured before installing this logrus hook") - -// ErrBugsnagSendFailed indicates that the hook failed to submit an error to -// bugsnag. The error was successfully generated, but `bugsnag.Notify()` -// failed. -type ErrBugsnagSendFailed struct { - err error -} - -func (e ErrBugsnagSendFailed) Error() string { - return "failed to send error to Bugsnag: " + e.err.Error() -} - -// NewBugsnagHook initializes a logrus hook which sends exceptions to an -// exception-tracking service compatible with the Bugsnag API. Before using -// this hook, you must call bugsnag.Configure(). The returned object should be -// registered with a log via `AddHook()` -// -// Entries that trigger an Error, Fatal or Panic should now include an "error" -// field to send to Bugsnag. -func NewBugsnagHook() (*bugsnagHook, error) { - if bugsnag.Config.APIKey == "" { - return nil, ErrBugsnagUnconfigured - } - return &bugsnagHook{}, nil -} - -// Fire forwards an error to Bugsnag. Given a logrus.Entry, it extracts the -// "error" field (or the Message if the error isn't present) and sends it off. -func (hook *bugsnagHook) Fire(entry *logrus.Entry) error { - var notifyErr error - err, ok := entry.Data["error"].(error) - if ok { - notifyErr = err - } else { - notifyErr = errors.New(entry.Message) - } - - bugsnagErr := bugsnag.Notify(notifyErr) - if bugsnagErr != nil { - return ErrBugsnagSendFailed{bugsnagErr} - } - - return nil -} - -// Levels enumerates the log levels on which the error should be forwarded to -// bugsnag: everything at or above the "Error" level. -func (hook *bugsnagHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.ErrorLevel, - logrus.FatalLevel, - logrus.PanicLevel, - } -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md deleted file mode 100644 index ae61e9229..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Papertrail Hook for Logrus :walrus: - -[Papertrail](https://papertrailapp.com) provides hosted log management. Once stored in Papertrail, you can [group](http://help.papertrailapp.com/kb/how-it-works/groups/) your logs on various dimensions, [search](http://help.papertrailapp.com/kb/how-it-works/search-syntax) them, and trigger [alerts](http://help.papertrailapp.com/kb/how-it-works/alerts). - -In most deployments, you'll want to send logs to Papertrail via their [remote_syslog](http://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-text-log-files-in-unix/) daemon, which requires no application-specific configuration. This hook is intended for relatively low-volume logging, likely in managed cloud hosting deployments where installing `remote_syslog` is not possible. - -## Usage - -You can find your Papertrail UDP port on your [Papertrail account page](https://papertrailapp.com/account/destinations). Substitute it below for `YOUR_PAPERTRAIL_UDP_PORT`. - -For `YOUR_APP_NAME`, substitute a short string that will readily identify your application or service in the logs. - -```go -import ( - "log/syslog" - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/papertrail" -) - -func main() { - log := logrus.New() - hook, err := logrus_papertrail.NewPapertrailHook("logs.papertrailapp.com", YOUR_PAPERTRAIL_UDP_PORT, YOUR_APP_NAME) - - if err == nil { - log.Hooks.Add(hook) - } -} -``` diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go deleted file mode 100644 index c0f10c1bd..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go +++ /dev/null @@ -1,55 +0,0 @@ -package logrus_papertrail - -import ( - "fmt" - "net" - "os" - "time" - - "github.com/Sirupsen/logrus" -) - -const ( - format = "Jan 2 15:04:05" -) - -// PapertrailHook to send logs to a logging service compatible with the Papertrail API. -type PapertrailHook struct { - Host string - Port int - AppName string - UDPConn net.Conn -} - -// NewPapertrailHook creates a hook to be added to an instance of logger. -func NewPapertrailHook(host string, port int, appName string) (*PapertrailHook, error) { - conn, err := net.Dial("udp", fmt.Sprintf("%s:%d", host, port)) - return &PapertrailHook{host, port, appName, conn}, err -} - -// Fire is called when a log event is fired. -func (hook *PapertrailHook) Fire(entry *logrus.Entry) error { - date := time.Now().Format(format) - msg, _ := entry.String() - payload := fmt.Sprintf("<22> %s %s: %s", date, hook.AppName, msg) - - bytesWritten, err := hook.UDPConn.Write([]byte(payload)) - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to send log line to Papertrail via UDP. Wrote %d bytes before error: %v", bytesWritten, err) - return err - } - - return nil -} - -// Levels returns the available logging levels. -func (hook *PapertrailHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - logrus.WarnLevel, - logrus.InfoLevel, - logrus.DebugLevel, - } -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md deleted file mode 100644 index 31de6540a..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md +++ /dev/null @@ -1,111 +0,0 @@ -# Sentry Hook for Logrus :walrus: - -[Sentry](https://getsentry.com) provides both self-hosted and hosted -solutions for exception tracking. -Both client and server are -[open source](https://github.com/getsentry/sentry). - -## Usage - -Every sentry application defined on the server gets a different -[DSN](https://www.getsentry.com/docs/). In the example below replace -`YOUR_DSN` with the one created for your application. - -```go -import ( - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/sentry" -) - -func main() { - log := logrus.New() - hook, err := logrus_sentry.NewSentryHook(YOUR_DSN, []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - }) - - if err == nil { - log.Hooks.Add(hook) - } -} -``` - -If you wish to initialize a SentryHook with tags, you can use the `NewWithTagsSentryHook` constructor to provide default tags: - -```go -tags := map[string]string{ - "site": "example.com", -} -levels := []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, -} -hook, err := logrus_sentry.NewWithTagsSentryHook(YOUR_DSN, tags, levels) - -``` - -If you wish to initialize a SentryHook with an already initialized raven client, you can use -the `NewWithClientSentryHook` constructor: - -```go -import ( - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/sentry" - "github.com/getsentry/raven-go" -) - -func main() { - log := logrus.New() - - client, err := raven.New(YOUR_DSN) - if err != nil { - log.Fatal(err) - } - - hook, err := logrus_sentry.NewWithClientSentryHook(client, []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - }) - - if err == nil { - log.Hooks.Add(hook) - } -} - -hook, err := NewWithClientSentryHook(client, []logrus.Level{ - logrus.ErrorLevel, -}) -``` - -## Special fields - -Some logrus fields have a special meaning in this hook, -these are `server_name`, `logger` and `http_request`. -When logs are sent to sentry these fields are treated differently. -- `server_name` (also known as hostname) is the name of the server which -is logging the event (hostname.example.com) -- `logger` is the part of the application which is logging the event. -In go this usually means setting it to the name of the package. -- `http_request` is the in-coming request(*http.Request). The detailed request data are sent to Sentry. - -## Timeout - -`Timeout` is the time the sentry hook will wait for a response -from the sentry server. - -If this time elapses with no response from -the server an error will be returned. - -If `Timeout` is set to 0 the SentryHook will not wait for a reply -and will assume a correct delivery. - -The SentryHook has a default timeout of `100 milliseconds` when created -with a call to `NewSentryHook`. This can be changed by assigning a value to the `Timeout` field: - -```go -hook, _ := logrus_sentry.NewSentryHook(...) -hook.Timeout = 20*time.Second -``` diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go deleted file mode 100644 index cf88098a8..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go +++ /dev/null @@ -1,137 +0,0 @@ -package logrus_sentry - -import ( - "fmt" - "net/http" - "time" - - "github.com/Sirupsen/logrus" - "github.com/getsentry/raven-go" -) - -var ( - severityMap = map[logrus.Level]raven.Severity{ - logrus.DebugLevel: raven.DEBUG, - logrus.InfoLevel: raven.INFO, - logrus.WarnLevel: raven.WARNING, - logrus.ErrorLevel: raven.ERROR, - logrus.FatalLevel: raven.FATAL, - logrus.PanicLevel: raven.FATAL, - } -) - -func getAndDel(d logrus.Fields, key string) (string, bool) { - var ( - ok bool - v interface{} - val string - ) - if v, ok = d[key]; !ok { - return "", false - } - - if val, ok = v.(string); !ok { - return "", false - } - delete(d, key) - return val, true -} - -func getAndDelRequest(d logrus.Fields, key string) (*http.Request, bool) { - var ( - ok bool - v interface{} - req *http.Request - ) - if v, ok = d[key]; !ok { - return nil, false - } - if req, ok = v.(*http.Request); !ok || req == nil { - return nil, false - } - delete(d, key) - return req, true -} - -// SentryHook delivers logs to a sentry server. -type SentryHook struct { - // Timeout sets the time to wait for a delivery error from the sentry server. - // If this is set to zero the server will not wait for any response and will - // consider the message correctly sent - Timeout time.Duration - - client *raven.Client - levels []logrus.Level -} - -// NewSentryHook creates a hook to be added to an instance of logger -// and initializes the raven client. -// This method sets the timeout to 100 milliseconds. -func NewSentryHook(DSN string, levels []logrus.Level) (*SentryHook, error) { - client, err := raven.New(DSN) - if err != nil { - return nil, err - } - return &SentryHook{100 * time.Millisecond, client, levels}, nil -} - -// NewWithTagsSentryHook creates a hook with tags to be added to an instance -// of logger and initializes the raven client. This method sets the timeout to -// 100 milliseconds. -func NewWithTagsSentryHook(DSN string, tags map[string]string, levels []logrus.Level) (*SentryHook, error) { - client, err := raven.NewWithTags(DSN, tags) - if err != nil { - return nil, err - } - return &SentryHook{100 * time.Millisecond, client, levels}, nil -} - -// NewWithClientSentryHook creates a hook using an initialized raven client. -// This method sets the timeout to 100 milliseconds. -func NewWithClientSentryHook(client *raven.Client, levels []logrus.Level) (*SentryHook, error) { - return &SentryHook{100 * time.Millisecond, client, levels}, nil -} - -// Called when an event should be sent to sentry -// Special fields that sentry uses to give more information to the server -// are extracted from entry.Data (if they are found) -// These fields are: logger, server_name and http_request -func (hook *SentryHook) Fire(entry *logrus.Entry) error { - packet := &raven.Packet{ - Message: entry.Message, - Timestamp: raven.Timestamp(entry.Time), - Level: severityMap[entry.Level], - Platform: "go", - } - - d := entry.Data - - if logger, ok := getAndDel(d, "logger"); ok { - packet.Logger = logger - } - if serverName, ok := getAndDel(d, "server_name"); ok { - packet.ServerName = serverName - } - if req, ok := getAndDelRequest(d, "http_request"); ok { - packet.Interfaces = append(packet.Interfaces, raven.NewHttp(req)) - } - packet.Extra = map[string]interface{}(d) - - _, errCh := hook.client.Capture(packet, nil) - timeout := hook.Timeout - if timeout != 0 { - timeoutCh := time.After(timeout) - select { - case err := <-errCh: - return err - case <-timeoutCh: - return fmt.Errorf("no response from sentry server in %s", timeout) - } - } - return nil -} - -// Levels returns the available logging levels. -func (hook *SentryHook) Levels() []logrus.Level { - return hook.levels -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md deleted file mode 100644 index 4dbb8e729..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Syslog Hooks for Logrus :walrus: - -## Usage - -```go -import ( - "log/syslog" - "github.com/Sirupsen/logrus" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" -) - -func main() { - log := logrus.New() - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - - if err == nil { - log.Hooks.Add(hook) - } -} -``` diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go deleted file mode 100644 index b6fa37462..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go +++ /dev/null @@ -1,59 +0,0 @@ -package logrus_syslog - -import ( - "fmt" - "github.com/Sirupsen/logrus" - "log/syslog" - "os" -) - -// SyslogHook to send logs via syslog. -type SyslogHook struct { - Writer *syslog.Writer - SyslogNetwork string - SyslogRaddr string -} - -// Creates a hook to be added to an instance of logger. This is called with -// `hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_DEBUG, "")` -// `if err == nil { log.Hooks.Add(hook) }` -func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string) (*SyslogHook, error) { - w, err := syslog.Dial(network, raddr, priority, tag) - return &SyslogHook{w, network, raddr}, err -} - -func (hook *SyslogHook) Fire(entry *logrus.Entry) error { - line, err := entry.String() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err) - return err - } - - switch entry.Level { - case logrus.PanicLevel: - return hook.Writer.Crit(line) - case logrus.FatalLevel: - return hook.Writer.Crit(line) - case logrus.ErrorLevel: - return hook.Writer.Err(line) - case logrus.WarnLevel: - return hook.Writer.Warning(line) - case logrus.InfoLevel: - return hook.Writer.Info(line) - case logrus.DebugLevel: - return hook.Writer.Debug(line) - default: - return nil - } -} - -func (hook *SyslogHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - logrus.WarnLevel, - logrus.InfoLevel, - logrus.DebugLevel, - } -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/json_formatter.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/json_formatter.go deleted file mode 100644 index 2ad6dc5cf..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/json_formatter.go +++ /dev/null @@ -1,41 +0,0 @@ -package logrus - -import ( - "encoding/json" - "fmt" -) - -type JSONFormatter struct { - // TimestampFormat sets the format used for marshaling timestamps. - TimestampFormat string -} - -func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields, len(entry.Data)+3) - for k, v := range entry.Data { - switch v := v.(type) { - case error: - // Otherwise errors are ignored by `encoding/json` - // https://github.com/Sirupsen/logrus/issues/137 - data[k] = v.Error() - default: - data[k] = v - } - } - prefixFieldClashes(data) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - - data["time"] = entry.Time.Format(timestampFormat) - data["msg"] = entry.Message - data["level"] = entry.Level.String() - - serialized, err := json.Marshal(data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/logger.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/logger.go deleted file mode 100644 index fd9804c64..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/logger.go +++ /dev/null @@ -1,206 +0,0 @@ -package logrus - -import ( - "io" - "os" - "sync" -) - -type Logger struct { - // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a - // file, or leave it default which is `os.Stderr`. You can also set this to - // something more adventorous, such as logging to Kafka. - Out io.Writer - // Hooks for the logger instance. These allow firing events based on logging - // levels and log entries. For example, to send errors to an error tracking - // service, log to StatsD or dump the core on fatal errors. - Hooks LevelHooks - // All log entries pass through the formatter before logged to Out. The - // included formatters are `TextFormatter` and `JSONFormatter` for which - // TextFormatter is the default. In development (when a TTY is attached) it - // logs with colors, but to a file it wouldn't. You can easily implement your - // own that implements the `Formatter` interface, see the `README` or included - // formatters for examples. - Formatter Formatter - // The logging level the logger should log at. This is typically (and defaults - // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be - // logged. `logrus.Debug` is useful in - Level Level - // Used to sync writing to the log. - mu sync.Mutex -} - -// Creates a new logger. Configuration should be set by changing `Formatter`, -// `Out` and `Hooks` directly on the default logger instance. You can also just -// instantiate your own: -// -// var log = &Logger{ -// Out: os.Stderr, -// Formatter: new(JSONFormatter), -// Hooks: make(LevelHooks), -// Level: logrus.DebugLevel, -// } -// -// It's recommended to make this a global instance called `log`. -func New() *Logger { - return &Logger{ - Out: os.Stderr, - Formatter: new(TextFormatter), - Hooks: make(LevelHooks), - Level: InfoLevel, - } -} - -// Adds a field to the log entry, note that you it doesn't log until you call -// Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry. -// If you want multiple fields, use `WithFields`. -func (logger *Logger) WithField(key string, value interface{}) *Entry { - return NewEntry(logger).WithField(key, value) -} - -// Adds a struct of fields to the log entry. All it does is call `WithField` for -// each `Field`. -func (logger *Logger) WithFields(fields Fields) *Entry { - return NewEntry(logger).WithFields(fields) -} - -func (logger *Logger) Debugf(format string, args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debugf(format, args...) - } -} - -func (logger *Logger) Infof(format string, args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Infof(format, args...) - } -} - -func (logger *Logger) Printf(format string, args ...interface{}) { - NewEntry(logger).Printf(format, args...) -} - -func (logger *Logger) Warnf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnf(format, args...) - } -} - -func (logger *Logger) Warningf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnf(format, args...) - } -} - -func (logger *Logger) Errorf(format string, args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Errorf(format, args...) - } -} - -func (logger *Logger) Fatalf(format string, args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatalf(format, args...) - } - os.Exit(1) -} - -func (logger *Logger) Panicf(format string, args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panicf(format, args...) - } -} - -func (logger *Logger) Debug(args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debug(args...) - } -} - -func (logger *Logger) Info(args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Info(args...) - } -} - -func (logger *Logger) Print(args ...interface{}) { - NewEntry(logger).Info(args...) -} - -func (logger *Logger) Warn(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warn(args...) - } -} - -func (logger *Logger) Warning(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warn(args...) - } -} - -func (logger *Logger) Error(args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Error(args...) - } -} - -func (logger *Logger) Fatal(args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatal(args...) - } - os.Exit(1) -} - -func (logger *Logger) Panic(args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panic(args...) - } -} - -func (logger *Logger) Debugln(args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debugln(args...) - } -} - -func (logger *Logger) Infoln(args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Infoln(args...) - } -} - -func (logger *Logger) Println(args ...interface{}) { - NewEntry(logger).Println(args...) -} - -func (logger *Logger) Warnln(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnln(args...) - } -} - -func (logger *Logger) Warningln(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnln(args...) - } -} - -func (logger *Logger) Errorln(args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Errorln(args...) - } -} - -func (logger *Logger) Fatalln(args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatalln(args...) - } - os.Exit(1) -} - -func (logger *Logger) Panicln(args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panicln(args...) - } -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/logrus.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/logrus.go deleted file mode 100644 index 0c09fbc26..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/logrus.go +++ /dev/null @@ -1,98 +0,0 @@ -package logrus - -import ( - "fmt" - "log" -) - -// Fields type, used to pass to `WithFields`. -type Fields map[string]interface{} - -// Level type -type Level uint8 - -// Convert the Level to a string. E.g. PanicLevel becomes "panic". -func (level Level) String() string { - switch level { - case DebugLevel: - return "debug" - case InfoLevel: - return "info" - case WarnLevel: - return "warning" - case ErrorLevel: - return "error" - case FatalLevel: - return "fatal" - case PanicLevel: - return "panic" - } - - return "unknown" -} - -// ParseLevel takes a string level and returns the Logrus log level constant. -func ParseLevel(lvl string) (Level, error) { - switch lvl { - case "panic": - return PanicLevel, nil - case "fatal": - return FatalLevel, nil - case "error": - return ErrorLevel, nil - case "warn", "warning": - return WarnLevel, nil - case "info": - return InfoLevel, nil - case "debug": - return DebugLevel, nil - } - - var l Level - return l, fmt.Errorf("not a valid logrus Level: %q", lvl) -} - -// These are the different logging levels. You can set the logging level to log -// on your instance of logger, obtained with `logrus.New()`. -const ( - // PanicLevel level, highest level of severity. Logs and then calls panic with the - // message passed to Debug, Info, ... - PanicLevel Level = iota - // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the - // logging level is set to Panic. - FatalLevel - // ErrorLevel level. Logs. Used for errors that should definitely be noted. - // Commonly used for hooks to send errors to an error tracking service. - ErrorLevel - // WarnLevel level. Non-critical entries that deserve eyes. - WarnLevel - // InfoLevel level. General operational entries about what's going on inside the - // application. - InfoLevel - // DebugLevel level. Usually only enabled when debugging. Very verbose logging. - DebugLevel -) - -// Won't compile if StdLogger can't be realized by a log.Logger -var ( - _ StdLogger = &log.Logger{} - _ StdLogger = &Entry{} - _ StdLogger = &Logger{} -) - -// StdLogger is what your logrus-enabled library should take, that way -// it'll accept a stdlib logger and a logrus logger. There's no standard -// interface, this is the closest we get, unfortunately. -type StdLogger interface { - Print(...interface{}) - Printf(string, ...interface{}) - Println(...interface{}) - - Fatal(...interface{}) - Fatalf(string, ...interface{}) - Fatalln(...interface{}) - - Panic(...interface{}) - Panicf(string, ...interface{}) - Panicln(...interface{}) -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_bsd.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_bsd.go deleted file mode 100644 index 71f8d67a5..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_bsd.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build darwin freebsd openbsd netbsd dragonfly - -package logrus - -import "syscall" - -const ioctlReadTermios = syscall.TIOCGETA - -type Termios syscall.Termios diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_linux.go deleted file mode 100644 index a2c0b40db..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_linux.go +++ /dev/null @@ -1,12 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package logrus - -import "syscall" - -const ioctlReadTermios = syscall.TCGETS - -type Termios syscall.Termios diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go deleted file mode 100644 index 4bb537602..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go +++ /dev/null @@ -1,21 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin freebsd openbsd netbsd dragonfly - -package logrus - -import ( - "syscall" - "unsafe" -) - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stdout - var termios Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_windows.go deleted file mode 100644 index 2e09f6f7e..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/terminal_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package logrus - -import ( - "syscall" - "unsafe" -) - -var kernel32 = syscall.NewLazyDLL("kernel32.dll") - -var ( - procGetConsoleMode = kernel32.NewProc("GetConsoleMode") -) - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stdout - var st uint32 - r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - return r != 0 && e == 0 -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/text_formatter.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/text_formatter.go deleted file mode 100644 index 17cc29848..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/text_formatter.go +++ /dev/null @@ -1,159 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "runtime" - "sort" - "strings" - "time" -) - -const ( - nocolor = 0 - red = 31 - green = 32 - yellow = 33 - blue = 34 - gray = 37 -) - -var ( - baseTimestamp time.Time - isTerminal bool -) - -func init() { - baseTimestamp = time.Now() - isTerminal = IsTerminal() -} - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. - DisableColors bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // TimestampFormat to use for display when a full timestamp is printed - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool -} - -func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { - var keys []string = make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - - if !f.DisableSorting { - sort.Strings(keys) - } - - b := &bytes.Buffer{} - - prefixFieldClashes(entry.Data) - - isColorTerminal := isTerminal && (runtime.GOOS != "windows") - isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - if isColored { - f.printColored(b, entry, keys, timestampFormat) - } else { - if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat)) - } - f.appendKeyValue(b, "level", entry.Level.String()) - f.appendKeyValue(b, "msg", entry.Message) - for _, key := range keys { - f.appendKeyValue(b, key, entry.Data[key]) - } - } - - b.WriteByte('\n') - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, timestampFormat string) { - var levelColor int - switch entry.Level { - case DebugLevel: - levelColor = gray - case WarnLevel: - levelColor = yellow - case ErrorLevel, FatalLevel, PanicLevel: - levelColor = red - default: - levelColor = blue - } - - levelText := strings.ToUpper(entry.Level.String())[0:4] - - if !f.FullTimestamp { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, miniTS(), entry.Message) - } else { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s] %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), entry.Message) - } - for _, k := range keys { - v := entry.Data[k] - fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=%+v", levelColor, k, v) - } -} - -func needsQuoting(text string) bool { - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { - return false - } - } - return true -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) { - - b.WriteString(key) - b.WriteByte('=') - - switch value := value.(type) { - case string: - if needsQuoting(value) { - b.WriteString(value) - } else { - fmt.Fprintf(b, "%q", value) - } - case error: - errmsg := value.Error() - if needsQuoting(errmsg) { - b.WriteString(errmsg) - } else { - fmt.Fprintf(b, "%q", value) - } - default: - fmt.Fprint(b, value) - } - - b.WriteByte(' ') -} diff --git a/alpine/packages/vendor/github.com/Sirupsen/logrus/writer.go b/alpine/packages/vendor/github.com/Sirupsen/logrus/writer.go deleted file mode 100644 index 1e30b1c75..000000000 --- a/alpine/packages/vendor/github.com/Sirupsen/logrus/writer.go +++ /dev/null @@ -1,31 +0,0 @@ -package logrus - -import ( - "bufio" - "io" - "runtime" -) - -func (logger *Logger) Writer() *io.PipeWriter { - reader, writer := io.Pipe() - - go logger.writerScanner(reader) - runtime.SetFinalizer(writer, writerFinalizer) - - return writer -} - -func (logger *Logger) writerScanner(reader *io.PipeReader) { - scanner := bufio.NewScanner(reader) - for scanner.Scan() { - logger.Print(scanner.Text()) - } - if err := scanner.Err(); err != nil { - logger.Errorf("Error while reading from Writer: %s", err) - } - reader.Close() -} - -func writerFinalizer(writer *io.PipeWriter) { - writer.Close() -} diff --git a/alpine/packages/vendor/manifest b/alpine/packages/vendor/manifest index 9f686cf79..19690cf88 100644 --- a/alpine/packages/vendor/manifest +++ b/alpine/packages/vendor/manifest @@ -11,4 +11,4 @@ "notests": true } ] -} \ No newline at end of file +} From 168fdedace330d1ad3a6b90e256cb53f470062eb Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:46:49 +0100 Subject: [PATCH 06/55] clean up diagnostics server build Signed-off-by: Justin Cormack --- alpine/packages/diagnostics/.gitignore | 2 +- alpine/packages/diagnostics/Dockerfile | 10 +++------- alpine/packages/diagnostics/Makefile | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/alpine/packages/diagnostics/.gitignore b/alpine/packages/diagnostics/.gitignore index 1802b3c31..826049f6e 100644 --- a/alpine/packages/diagnostics/.gitignore +++ b/alpine/packages/diagnostics/.gitignore @@ -1,2 +1,2 @@ diagnostics-server -/vendor \ No newline at end of file +files diff --git a/alpine/packages/diagnostics/Dockerfile b/alpine/packages/diagnostics/Dockerfile index e3c2f659a..626759fde 100644 --- a/alpine/packages/diagnostics/Dockerfile +++ b/alpine/packages/diagnostics/Dockerfile @@ -1,13 +1,9 @@ FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2 -RUN mkdir -p /go/src/diagnostics -WORKDIR /go/src/diagnostics +COPY ./ /go/src/diagnostics-server/ -COPY . /go/src/diagnostics - -ARG GOARCH -ARG GOOS +WORKDIR /go/src/diagnostics-server RUN go install --ldflags '-extldflags "-fno-PIC"' -RUN [ -f /go/bin/*/diagnostics ] && mv /go/bin/*/diagnostics /go/bin/ || true +CMD ["tar", "cf", "-", "-C", "/go/bin", "diagnostics-server"] diff --git a/alpine/packages/diagnostics/Makefile b/alpine/packages/diagnostics/Makefile index af5b6ea59..f401eee28 100644 --- a/alpine/packages/diagnostics/Makefile +++ b/alpine/packages/diagnostics/Makefile @@ -1,15 +1,15 @@ all: diagnostics-server -.PHONY: vendor -vendor: - mkdir -p ./vendor - cp -r ../vendor/* ./vendor/ +files: + ls Dockerfile *.go > files + printf -- '-C\n..\n' >> files + (cd .. && find vendor) >> files -diagnostics-server: Dockerfile main.go vendor - docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t diagnostics:build . - docker run --rm diagnostics:build cat /go/bin/diagnostics > diagnostics-server - chmod 755 diagnostics-server +diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files + tar cf - -T files | docker build -t diagnostics-server:build - + docker run --rm diagnostics-server:build | tar xf - clean: - rm -rf diagnostics-server vendor - docker images -q diagnostics:build | xargs docker rmi -f || true + rm -rf diagnostics-server files + +.DELETE_ON_ERROR: From effff65ecdf3a16556e089b7ebe44eb6911e5584 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:50:22 +0100 Subject: [PATCH 07/55] simplify Dockerfile Signed-off-by: Justin Cormack --- alpine/packages/proxy/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/alpine/packages/proxy/Dockerfile b/alpine/packages/proxy/Dockerfile index 9e8835d6c..29091eee0 100644 --- a/alpine/packages/proxy/Dockerfile +++ b/alpine/packages/proxy/Dockerfile @@ -1,10 +1,9 @@ FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2 -RUN mkdir -p /go/src/proxy -WORKDIR /go/src/proxy - COPY ./ /go/src/proxy/ +WORKDIR /go/src/proxy + RUN go install --ldflags '-extldflags "-fno-PIC"' CMD ["tar", "cf", "-", "-C", "/go/bin", "proxy"] From 7a3dda49955b580305382c3d3af1b46c54e5f7dc Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:54:47 +0100 Subject: [PATCH 08/55] remove unused include, it is all in the Go code Signed-off-by: Justin Cormack --- .../vsudd/include/uapi/linux/vm_sockets.h | 161 ------------------ 1 file changed, 161 deletions(-) delete mode 100644 alpine/packages/vsudd/include/uapi/linux/vm_sockets.h diff --git a/alpine/packages/vsudd/include/uapi/linux/vm_sockets.h b/alpine/packages/vsudd/include/uapi/linux/vm_sockets.h deleted file mode 100644 index 41934a185..000000000 --- a/alpine/packages/vsudd/include/uapi/linux/vm_sockets.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * VMware vSockets Driver - * - * Copyright (C) 2007-2013 VMware, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation version 2 and no later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef _UAPI_VM_SOCKETS_H -#define _UAPI_VM_SOCKETS_H - -#ifdef __KERNEL__ -#include -#else -#define __kernel_sa_family_t sa_family_t -#include -#endif - -/* Option name for STREAM socket buffer size. Use as the option name in - * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that - * specifies the size of the buffer underlying a vSockets STREAM socket. - * Value is clamped to the MIN and MAX. - */ - -#define SO_VM_SOCKETS_BUFFER_SIZE 0 - -/* Option name for STREAM socket minimum buffer size. Use as the option name - * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long that - * specifies the minimum size allowed for the buffer underlying a vSockets - * STREAM socket. - */ - -#define SO_VM_SOCKETS_BUFFER_MIN_SIZE 1 - -/* Option name for STREAM socket maximum buffer size. Use as the option name - * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long - * that specifies the maximum size allowed for the buffer underlying a - * vSockets STREAM socket. - */ - -#define SO_VM_SOCKETS_BUFFER_MAX_SIZE 2 - -/* Option name for socket peer's host-specific VM ID. Use as the option name - * in getsockopt(3) to get a host-specific identifier for the peer endpoint's - * VM. The identifier is a signed integer. - * Only available for hypervisor endpoints. - */ - -#define SO_VM_SOCKETS_PEER_HOST_VM_ID 3 - -/* Option name for determining if a socket is trusted. Use as the option name - * in getsockopt(3) to determine if a socket is trusted. The value is a - * signed integer. - */ - -#define SO_VM_SOCKETS_TRUSTED 5 - -/* Option name for STREAM socket connection timeout. Use as the option name - * in setsockopt(3) or getsockopt(3) to set or get the connection - * timeout for a STREAM socket. - */ - -#define SO_VM_SOCKETS_CONNECT_TIMEOUT 6 - -/* Option name for using non-blocking send/receive. Use as the option name - * for setsockopt(3) or getsockopt(3) to set or get the non-blocking - * transmit/receive flag for a STREAM socket. This flag determines whether - * send() and recv() can be called in non-blocking contexts for the given - * socket. The value is a signed integer. - * - * This option is only relevant to kernel endpoints, where descheduling the - * thread of execution is not allowed, for example, while holding a spinlock. - * It is not to be confused with conventional non-blocking socket operations. - * - * Only available for hypervisor endpoints. - */ - -#define SO_VM_SOCKETS_NONBLOCK_TXRX 7 - -/* The vSocket equivalent of INADDR_ANY. This works for the svm_cid field of - * sockaddr_vm and indicates the context ID of the current endpoint. - */ - -#define VMADDR_CID_ANY -1U - -/* Bind to any available port. Works for the svm_port field of - * sockaddr_vm. - */ - -#define VMADDR_PORT_ANY -1U - -/* Use this as the destination CID in an address when referring to the - * hypervisor. VMCI relies on it being 0, but this would be useful for other - * transports too. - */ - -#define VMADDR_CID_HYPERVISOR 0 - -/* This CID is specific to VMCI and can be considered reserved (even VMCI - * doesn't use it anymore, it's a legacy value from an older release). - */ - -#define VMADDR_CID_RESERVED 1 - -/* Use this as the destination CID in an address when referring to the host - * (any process other than the hypervisor). VMCI relies on it being 2, but - * this would be useful for other transports too. - */ - -#define VMADDR_CID_HOST 2 - -/* Invalid vSockets version. */ - -#define VM_SOCKETS_INVALID_VERSION -1U - -/* The epoch (first) component of the vSockets version. A single byte - * representing the epoch component of the vSockets version. - */ - -#define VM_SOCKETS_VERSION_EPOCH(_v) (((_v) & 0xFF000000) >> 24) - -/* The major (second) component of the vSockets version. A single byte - * representing the major component of the vSockets version. Typically - * changes for every major release of a product. - */ - -#define VM_SOCKETS_VERSION_MAJOR(_v) (((_v) & 0x00FF0000) >> 16) - -/* The minor (third) component of the vSockets version. Two bytes representing - * the minor component of the vSockets version. - */ - -#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF)) - -/* Address structure for vSockets. The address family should be set to - * AF_VSOCK. The structure members should all align on their natural - * boundaries without resorting to compiler packing directives. The total size - * of this structure should be exactly the same as that of struct sockaddr. - */ - -struct sockaddr_vm { - __kernel_sa_family_t svm_family; - unsigned short svm_reserved1; - unsigned int svm_port; - unsigned int svm_cid; - unsigned char svm_zero[sizeof(struct sockaddr) - - sizeof(sa_family_t) - - sizeof(unsigned short) - - sizeof(unsigned int) - sizeof(unsigned int)]; -}; - -#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) - -#endif /* _UAPI_VM_SOCKETS_H */ From b4d9394f5097d4aed3b932741258aa9374247934 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 17:59:00 +0100 Subject: [PATCH 09/55] clean up vsudd build like proxy Signed-off-by: Justin Cormack --- alpine/packages/vsudd/.gitignore | 4 ++-- alpine/packages/vsudd/Dockerfile | 10 +++------- alpine/packages/vsudd/Makefile | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/alpine/packages/vsudd/.gitignore b/alpine/packages/vsudd/.gitignore index 50802866b..03530f774 100644 --- a/alpine/packages/vsudd/.gitignore +++ b/alpine/packages/vsudd/.gitignore @@ -1,2 +1,2 @@ -/vsudd -/vendor \ No newline at end of file +vsudd +files diff --git a/alpine/packages/vsudd/Dockerfile b/alpine/packages/vsudd/Dockerfile index 05f84f184..0676ad8f6 100644 --- a/alpine/packages/vsudd/Dockerfile +++ b/alpine/packages/vsudd/Dockerfile @@ -1,13 +1,9 @@ FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2 -RUN mkdir -p /go/src/vsudd +COPY ./ /go/src/vsudd/ + WORKDIR /go/src/vsudd -COPY . /go/src/vsudd/ - -ARG GOARCH -ARG GOOS - RUN go install --ldflags '-extldflags "-fno-PIC"' -RUN [ -f /go/bin/*/vsudd ] && mv /go/bin/*/vsudd /go/bin/ || true +CMD ["tar", "cf", "-", "-C", "/go/bin", "vsudd"] diff --git a/alpine/packages/vsudd/Makefile b/alpine/packages/vsudd/Makefile index 1a40be85b..b1e7a52d6 100644 --- a/alpine/packages/vsudd/Makefile +++ b/alpine/packages/vsudd/Makefile @@ -1,15 +1,15 @@ all: vsudd -.PHONY: vendor -vendor: - mkdir -p ./vendor - cp -r ../vendor/* ./vendor/ +files: + ls Dockerfile *.go > files + printf -- '-C\n..\n' >> files + (cd .. && find vendor) >> files -vsudd: Dockerfile main.go vendor - docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t vsudd:build . - docker run --rm vsudd:build cat /go/bin/vsudd > vsudd - chmod 755 vsudd +vsudd: Dockerfile $(wildcard *.go) ../vendor/manifest files + tar cf - -T files | docker build -t vsudd:build - + docker run --rm vsudd:build | tar xf - clean: - rm -rf vsudd vendor - docker images -q vsudd:build | xargs docker rmi -f || true + rm -rf vsudd files + +.DELETE_ON_ERROR: From d00ed9ce6ea8a6c1904d5900cf8454b1b23f5dbd Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 18:14:40 +0100 Subject: [PATCH 10/55] run with no network Signed-off-by: Justin Cormack --- alpine/packages/diagnostics/Makefile | 2 +- alpine/packages/proxy/Makefile | 2 +- alpine/packages/vsudd/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine/packages/diagnostics/Makefile b/alpine/packages/diagnostics/Makefile index f401eee28..0175bf55e 100644 --- a/alpine/packages/diagnostics/Makefile +++ b/alpine/packages/diagnostics/Makefile @@ -7,7 +7,7 @@ files: diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files tar cf - -T files | docker build -t diagnostics-server:build - - docker run --rm diagnostics-server:build | tar xf - + docker run --rm --net=none diagnostics-server:build | tar xf - clean: rm -rf diagnostics-server files diff --git a/alpine/packages/proxy/Makefile b/alpine/packages/proxy/Makefile index cbe7494d9..df1f82903 100644 --- a/alpine/packages/proxy/Makefile +++ b/alpine/packages/proxy/Makefile @@ -8,7 +8,7 @@ files: proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../vendor/manifest files tar cf - -T files | docker build -t proxy:build - - docker run --rm proxy:build | tar xf - + docker run --rm --net=none proxy:build | tar xf - clean: rm -rf proxy files diff --git a/alpine/packages/vsudd/Makefile b/alpine/packages/vsudd/Makefile index b1e7a52d6..2313c1cf2 100644 --- a/alpine/packages/vsudd/Makefile +++ b/alpine/packages/vsudd/Makefile @@ -7,7 +7,7 @@ files: vsudd: Dockerfile $(wildcard *.go) ../vendor/manifest files tar cf - -T files | docker build -t vsudd:build - - docker run --rm vsudd:build | tar xf - + docker run --rm --net=none vsudd:build | tar xf - clean: rm -rf vsudd files From cc89e32c0369fea9c21ccd0cbdaed437745bd3ab Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 18:16:37 +0100 Subject: [PATCH 11/55] no longer need OS here Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index a0cea13b5..73b2010f3 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -1,12 +1,12 @@ all: $(MAKE) -C proxy - $(MAKE) -C diagnostics OS=linux + $(MAKE) -C diagnostics $(MAKE) -C transfused OS=linux $(MAKE) -C tap-vsockd OS=linux $(MAKE) -C hvtools OS=linux $(MAKE) -C docker OS=Linux $(MAKE) -C nc-vsock OS=linux - $(MAKE) -C vsudd OS=linux + $(MAKE) -C vsudd $(MAKE) -C 9pmount-vsock OS=linux $(MAKE) -C iptables OS=linux From 98beff2fa0daff48b0431a21d01efa3ea8e480cf Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 18:25:25 +0100 Subject: [PATCH 12/55] clean up docker Makefile Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 2 +- alpine/packages/docker/.gitignore | 1 - alpine/packages/docker/Makefile | 13 ++++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 73b2010f3..33abd7eb0 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -4,7 +4,7 @@ all: $(MAKE) -C transfused OS=linux $(MAKE) -C tap-vsockd OS=linux $(MAKE) -C hvtools OS=linux - $(MAKE) -C docker OS=Linux + $(MAKE) -C docker $(MAKE) -C nc-vsock OS=linux $(MAKE) -C vsudd $(MAKE) -C 9pmount-vsock OS=linux diff --git a/alpine/packages/docker/.gitignore b/alpine/packages/docker/.gitignore index 861389dec..e660fd93d 100644 --- a/alpine/packages/docker/.gitignore +++ b/alpine/packages/docker/.gitignore @@ -1,2 +1 @@ bin/ -docker.git diff --git a/alpine/packages/docker/Makefile b/alpine/packages/docker/Makefile index 58e9e3bda..e9d279d6a 100644 --- a/alpine/packages/docker/Makefile +++ b/alpine/packages/docker/Makefile @@ -3,16 +3,15 @@ ARCH?=x86_64 OS?=Linux DOCKER_EXPERIMENTAL?=1 -all: bin +all: bin/docker TEST_HOST=$(shell if echo "$(DOCKER_VERSION)" | grep -q -- '-rc'; then echo "test.docker.com"; else echo "get.docker.com"; fi) DOCKER_HOST?=$(shell [ "${DOCKER_EXPERIMENTAL}" -eq 1 ] && printf "experimental.docker.com" || printf "${TEST_HOST}") DOCKER_BIN_URL?="https://${DOCKER_HOST}/builds/${OS}/${ARCH}/docker-${DOCKER_VERSION}.tgz" -bin: +bin/docker: mkdir -p bin - curl -sSL -o docker.tgz ${DOCKER_BIN_URL} - tar xzf docker.tgz && \ + curl -sSL ${DOCKER_BIN_URL} | tar xzf - && \ mv docker/docker-containerd-ctr \ docker/docker \ docker/docker-containerd \ @@ -21,8 +20,8 @@ bin: docker/docker-runc \ docker/docker-containerd-shim \ bin/ - rm -rf docker/ docker.tgz - chmod +x bin/* clean: - rm -rf bin docker/ docker.tgz + rm -rf bin/ docker/ + +.DELETE_ON_ERROR: From 57d1e7e2321eb35bccd9d2dec8320e70f9a1a7db Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 18:43:25 +0100 Subject: [PATCH 13/55] clean up tap-vsockd build process Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 2 +- alpine/packages/tap-vsockd/Dockerfile | 9 +++++---- alpine/packages/tap-vsockd/Makefile | 24 ++++-------------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 33abd7eb0..38bf95668 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -2,7 +2,7 @@ all: $(MAKE) -C proxy $(MAKE) -C diagnostics $(MAKE) -C transfused OS=linux - $(MAKE) -C tap-vsockd OS=linux + $(MAKE) -C tap-vsockd $(MAKE) -C hvtools OS=linux $(MAKE) -C docker $(MAKE) -C nc-vsock OS=linux diff --git a/alpine/packages/tap-vsockd/Dockerfile b/alpine/packages/tap-vsockd/Dockerfile index 4e5990dd0..093ef7887 100644 --- a/alpine/packages/tap-vsockd/Dockerfile +++ b/alpine/packages/tap-vsockd/Dockerfile @@ -1,8 +1,9 @@ FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b -RUN mkdir -p /tap-vsockd -WORKDIR /tap-vsockd - COPY . /tap-vsockd -RUN make tap-vsockd +WORKDIR /tap-vsockd + +RUN gcc -Wall -Werror tap-vsockd.c hvsock.c protocol.c -lpthread -o tap-vsockd + +CMD ["tar", "cf", "-", "tap-vsockd"] diff --git a/alpine/packages/tap-vsockd/Makefile b/alpine/packages/tap-vsockd/Makefile index f0f3eb82e..5b330c4f6 100644 --- a/alpine/packages/tap-vsockd/Makefile +++ b/alpine/packages/tap-vsockd/Makefile @@ -1,24 +1,8 @@ -.PHONY: all +DEPS=Dockerfile $(wildcard *.c *.h) -DEPS=tap-vsockd.c hvsock.c hvsock.h protocol.c protocol.h - -all: Dockerfile $(DEPS) - docker build -t tap-vsockd:build . - docker run --rm tap-vsockd:build cat tap-vsockd > tap-vsockd - chmod 755 tap-vsockd - -tap-vsockd: hvsock.o protocol.o tap-vsockd.o - gcc -Wall -Werror -o tap-vsockd tap-vsockd.o protocol.o hvsock.o -lpthread - -hvsock.o: hvsock.c hvsock.h - gcc -Wall -Werror -c hvsock.c - -protocol.o: protocol.c - gcc -Wall -Werror -c protocol.c - -tap-vsockd.o: tap-vsockd.c hvsock.h - gcc -Wall -Werror -c tap-vsockd.c +tap-vsockd: $(DEPS) + tar cf - $(DEPS) | docker build -t tap-vsockd:build - + docker run --rm --net=none tap-vsockd:build | tar xf - clean: rm -f tap-vsockd - docker images -q tap-vsockd:build | xargs docker rmi -f || true From d2551be515c6d110b3afbc8266784b7d75c231ef Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 19:12:54 +0100 Subject: [PATCH 14/55] clean up hvtools build Signed-off-by: Justin Cormack --- alpine/packages/hvtools/Dockerfile | 5 ++--- alpine/packages/hvtools/Makefile | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/alpine/packages/hvtools/Dockerfile b/alpine/packages/hvtools/Dockerfile index b69f9963c..5860c29cc 100644 --- a/alpine/packages/hvtools/Dockerfile +++ b/alpine/packages/hvtools/Dockerfile @@ -1,9 +1,8 @@ FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b -RUN mkdir -p /hvtools - COPY src /hvtools/ -RUN tar czvf /hvtools.tar.gz hvtools WORKDIR /hvtools RUN make + +CMD ["tar", "cf", "-", "hv_fcopy_daemon", "hv_kvp_daemon", "hv_vss_daemon"] diff --git a/alpine/packages/hvtools/Makefile b/alpine/packages/hvtools/Makefile index 3c1565733..67efe1d72 100644 --- a/alpine/packages/hvtools/Makefile +++ b/alpine/packages/hvtools/Makefile @@ -1,13 +1,13 @@ -all: hvtools +all: hv_fcopy_daemon hvtools.tar.gz -hvtools: Dockerfile src/* - docker build -t hvtools:build . - docker run --rm hvtools:build cat /hvtools.tar.gz > hvtools.tar.gz - docker run --rm hvtools:build cat /hvtools/hv_fcopy_daemon > hv_fcopy_daemon - docker run --rm hvtools:build cat /hvtools/hv_kvp_daemon > hv_kvp_daemon - docker run --rm hvtools:build cat /hvtools/hv_vss_daemon > hv_vss_daemon - chmod 755 hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon +hv_fcopy_daemon: Dockerfile src/* + tar cf - Dockerfile src | docker build -t hvtools:build - + docker run --rm --net=none hvtools:build | tar xf - + +hvtools.tar.gz: src/* + tar czf hvtools.tar.gz src clean: - rm -f hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon - docker images -q hvtools:build | xargs docker rmi -f || true + rm -f hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon hvtools.tar.gz + +.DELETE_ON_ERROR: From 349e98c625009cc95bd25b5315b0168efd5894d4 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 19:13:35 +0100 Subject: [PATCH 15/55] remove unused OS= Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 38bf95668..80df78831 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -3,12 +3,12 @@ all: $(MAKE) -C diagnostics $(MAKE) -C transfused OS=linux $(MAKE) -C tap-vsockd - $(MAKE) -C hvtools OS=linux + $(MAKE) -C hvtools $(MAKE) -C docker $(MAKE) -C nc-vsock OS=linux $(MAKE) -C vsudd $(MAKE) -C 9pmount-vsock OS=linux - $(MAKE) -C iptables OS=linux + $(MAKE) -C iptables clean: $(MAKE) -C proxy clean From c52d04a248096b8181168d442e46acabdf9dbcd1 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 19:17:47 +0100 Subject: [PATCH 16/55] use cc Signed-off-by: Justin Cormack --- alpine/packages/tap-vsockd/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine/packages/tap-vsockd/Dockerfile b/alpine/packages/tap-vsockd/Dockerfile index 093ef7887..b65017eb1 100644 --- a/alpine/packages/tap-vsockd/Dockerfile +++ b/alpine/packages/tap-vsockd/Dockerfile @@ -4,6 +4,6 @@ COPY . /tap-vsockd WORKDIR /tap-vsockd -RUN gcc -Wall -Werror tap-vsockd.c hvsock.c protocol.c -lpthread -o tap-vsockd +RUN cc -Wall -Werror tap-vsockd.c hvsock.c protocol.c -lpthread -o tap-vsockd CMD ["tar", "cf", "-", "tap-vsockd"] From e42d59045d12ce7baa722d06f9bebcce6847c824 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 19:46:14 +0100 Subject: [PATCH 17/55] clean up 9pmount-vsock build Signed-off-by: Justin Cormack --- alpine/packages/9pmount-vsock/Dockerfile | 9 +++++---- alpine/packages/9pmount-vsock/Makefile | 21 ++++----------------- alpine/packages/Makefile | 2 +- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/alpine/packages/9pmount-vsock/Dockerfile b/alpine/packages/9pmount-vsock/Dockerfile index ae76d2d2d..5b5635555 100644 --- a/alpine/packages/9pmount-vsock/Dockerfile +++ b/alpine/packages/9pmount-vsock/Dockerfile @@ -1,8 +1,9 @@ FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b -RUN mkdir -p /9pmount-vsock -WORKDIR /9pmount-vsock - COPY . /9pmount-vsock -RUN make 9pmount-vsock +WORKDIR /9pmount-vsock + +RUN cc -Wall -Werror 9pmount-vsock.c hvsock.c -lpthread -o 9pmount-vsock + +CMD ["tar", "cf", "-", "9pmount-vsock"] diff --git a/alpine/packages/9pmount-vsock/Makefile b/alpine/packages/9pmount-vsock/Makefile index 653d84bc1..595a82e92 100644 --- a/alpine/packages/9pmount-vsock/Makefile +++ b/alpine/packages/9pmount-vsock/Makefile @@ -1,21 +1,8 @@ -.PHONY: all +DEPS=Dockerfile $(wildcard *.c *.h) -DEPS=9pmount-vsock.c hvsock.c hvsock.h - -all: Dockerfile $(DEPS) - docker build -t 9pmount-vsock:build . - docker run --rm 9pmount-vsock:build cat 9pmount-vsock > 9pmount-vsock - chmod 755 9pmount-vsock - -9pmount-vsock: 9pmount-vsock.o hvsock.o - gcc -Wall -Werror -o 9pmount-vsock 9pmount-vsock.o hvsock.o -lpthread - -9pmount-vsock.o: 9pmount-vsock.c hvsock.h - gcc -Wall -Werror -c 9pmount-vsock.c - -hvsock.o: hvsock.c hvsock.h - gcc -Wall -Werror -c hvsock.c +9pmount-vsock: $(DEPS) + tar cf - $(DEPS) | docker build -t 9pmount-vsock:build - + docker run --rm --net=none 9pmount-vsock:build | tar xf - clean: rm -f 9pmount-vsock - docker images -q 9pmount-vsock:build | xargs docker rmi -f || true diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 80df78831..126c14794 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -7,7 +7,7 @@ all: $(MAKE) -C docker $(MAKE) -C nc-vsock OS=linux $(MAKE) -C vsudd - $(MAKE) -C 9pmount-vsock OS=linux + $(MAKE) -C 9pmount-vsock $(MAKE) -C iptables clean: From d4c09bbd921b081b1e486862889a69e151fb1cad Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 19:52:03 +0100 Subject: [PATCH 18/55] move include file Signed-off-by: Justin Cormack --- alpine/packages/nc-vsock/nc-vsock.c | 2 +- alpine/packages/nc-vsock/{include/uapi/linux => }/vm_sockets.h | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename alpine/packages/nc-vsock/{include/uapi/linux => }/vm_sockets.h (100%) diff --git a/alpine/packages/nc-vsock/nc-vsock.c b/alpine/packages/nc-vsock/nc-vsock.c index 14c449f33..ef5d77c43 100644 --- a/alpine/packages/nc-vsock/nc-vsock.c +++ b/alpine/packages/nc-vsock/nc-vsock.c @@ -10,7 +10,7 @@ #include #include #include -#include "include/uapi/linux/vm_sockets.h" +#include "vm_sockets.h" #define MODE_READ 1 /* From the vsock */ #define MODE_WRITE 2 /* To the vsock */ diff --git a/alpine/packages/nc-vsock/include/uapi/linux/vm_sockets.h b/alpine/packages/nc-vsock/vm_sockets.h similarity index 100% rename from alpine/packages/nc-vsock/include/uapi/linux/vm_sockets.h rename to alpine/packages/nc-vsock/vm_sockets.h From b06a5fa6ebb0125801c4f3047eeaf2f7e9b5077e Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 19:56:16 +0100 Subject: [PATCH 19/55] clean up nc-vsock build Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 2 +- alpine/packages/nc-vsock/Dockerfile | 9 +++++---- alpine/packages/nc-vsock/Makefile | 13 +++---------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 126c14794..7caaa1365 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -5,7 +5,7 @@ all: $(MAKE) -C tap-vsockd $(MAKE) -C hvtools $(MAKE) -C docker - $(MAKE) -C nc-vsock OS=linux + $(MAKE) -C nc-vsock $(MAKE) -C vsudd $(MAKE) -C 9pmount-vsock $(MAKE) -C iptables diff --git a/alpine/packages/nc-vsock/Dockerfile b/alpine/packages/nc-vsock/Dockerfile index e6cedd3a9..bf27c4854 100644 --- a/alpine/packages/nc-vsock/Dockerfile +++ b/alpine/packages/nc-vsock/Dockerfile @@ -1,8 +1,9 @@ FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b -RUN mkdir -p /nc-vsock -WORKDIR /nc-vsock - COPY . /nc-vsock -RUN make nc-vsock +WORKDIR /nc-vsock + +RUN cc -Wall -Werror -o nc-vsock nc-vsock.c -luuid + +CMD ["tar", "cf", "-", "nc-vsock"] diff --git a/alpine/packages/nc-vsock/Makefile b/alpine/packages/nc-vsock/Makefile index 469721faa..0bc2d2d1b 100644 --- a/alpine/packages/nc-vsock/Makefile +++ b/alpine/packages/nc-vsock/Makefile @@ -1,15 +1,8 @@ -.PHONY: all - -DEPS=nc-vsock.c - -all: Dockerfile $(DEPS) - docker build -t nc-vsock:build . - docker run --rm nc-vsock:build cat nc-vsock > nc-vsock - chmod 755 nc-vsock +DEPS=Dockerfile $(wildcard *.c *.h) nc-vsock: $(DEPS) - gcc -Wall -Werror -o nc-vsock nc-vsock.c -luuid + tar cf - $(DEPS) | docker build -t nc-vsock:build - + docker run --rm --net=none nc-vsock:build | tar xf - clean: rm -f nc-vsock - docker images -q nc-vsock:build | xargs docker rmi -f || true From b75711b4cde3b7ac85dcbb8c7d99f80fe6ca71d3 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 20:02:13 +0100 Subject: [PATCH 20/55] clean up transfused build Signed-off-by: Justin Cormack --- alpine/packages/Makefile | 2 +- alpine/packages/transfused/Dockerfile | 9 +++++---- alpine/packages/transfused/Makefile | 16 +++------------- alpine/packages/transfused/transfused_vsock.c | 2 +- .../{include/uapi/linux => }/vm_sockets.h | 0 5 files changed, 10 insertions(+), 19 deletions(-) rename alpine/packages/transfused/{include/uapi/linux => }/vm_sockets.h (100%) diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 7caaa1365..49339542b 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -1,7 +1,7 @@ all: $(MAKE) -C proxy $(MAKE) -C diagnostics - $(MAKE) -C transfused OS=linux + $(MAKE) -C transfused $(MAKE) -C tap-vsockd $(MAKE) -C hvtools $(MAKE) -C docker diff --git a/alpine/packages/transfused/Dockerfile b/alpine/packages/transfused/Dockerfile index 1a9458ac4..f075309fe 100644 --- a/alpine/packages/transfused/Dockerfile +++ b/alpine/packages/transfused/Dockerfile @@ -1,8 +1,9 @@ FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b -RUN mkdir -p /transfused -WORKDIR /transfused - COPY . /transfused -RUN make transfused +WORKDIR /transfused + +RUN cc -g -static -Wall -Werror -o transfused transfused.c transfused_log.c transfused_vsock.c + +CMD ["tar", "cf", "-", "transfused"] diff --git a/alpine/packages/transfused/Makefile b/alpine/packages/transfused/Makefile index d1bfc5fa3..34e1e57f0 100644 --- a/alpine/packages/transfused/Makefile +++ b/alpine/packages/transfused/Makefile @@ -1,18 +1,8 @@ -.PHONY: all - -HDR=transfused.h transfused_log.h transfused_vsock.h -SRC=transfused.c transfused_log.c transfused_vsock.c -DEPS=$(HDR) $(SRC) - - -all: Dockerfile $(DEPS) - docker build -t transfused:build . - docker run --rm transfused:build cat transfused > transfused - chmod 755 transfused +DEPS=Dockerfile $(wildcard *.c *.h) transfused: $(DEPS) - gcc -g -static -Wall -Werror -o transfused $(SRC) + tar cf - $(DEPS) | docker build -t transfused:build - + docker run --rm --net=none transfused:build | tar xf - clean: rm -f transfused - docker images -q transfused:build | xargs docker rmi -f || true diff --git a/alpine/packages/transfused/transfused_vsock.c b/alpine/packages/transfused/transfused_vsock.c index 25e0219dd..08408dd0e 100644 --- a/alpine/packages/transfused/transfused_vsock.c +++ b/alpine/packages/transfused/transfused_vsock.c @@ -3,7 +3,7 @@ #include -#include "include/uapi/linux/vm_sockets.h" +#include "vm_sockets.h" #include "transfused_log.h" diff --git a/alpine/packages/transfused/include/uapi/linux/vm_sockets.h b/alpine/packages/transfused/vm_sockets.h similarity index 100% rename from alpine/packages/transfused/include/uapi/linux/vm_sockets.h rename to alpine/packages/transfused/vm_sockets.h From 5ae109fc2335b52f5d29cf38cf51aacbccf2f2fc Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 20:40:16 +0100 Subject: [PATCH 21/55] build packages in parallel Signed-off-by: Justin Cormack --- alpine/Makefile | 2 +- alpine/packages/Makefile | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/alpine/Makefile b/alpine/Makefile index 1a10603a4..daa853b9b 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -5,7 +5,7 @@ ETCFILES+=etc/inittab etc/fstab initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) rm -f initrd.img - $(MAKE) -C packages + $(MAKE) -j -C packages $(MAKE) -C kernel docker build -t moby-initrd:build . docker run --net=none --rm moby-initrd:build /bin/mkinitrd.sh > $@ diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 49339542b..4af716eca 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -1,23 +1,10 @@ -all: - $(MAKE) -C proxy - $(MAKE) -C diagnostics - $(MAKE) -C transfused - $(MAKE) -C tap-vsockd - $(MAKE) -C hvtools - $(MAKE) -C docker - $(MAKE) -C nc-vsock - $(MAKE) -C vsudd - $(MAKE) -C 9pmount-vsock - $(MAKE) -C iptables +DEPS=proxy diagnostics transfused tap-vsockd hvtools docker nc-vsock vsudd 9pmount-vsock iptables +.PHONY: clean $(DEPS) + +default: $(DEPS) + +$(DEPS): + $(MAKE) -C $@ clean: - $(MAKE) -C proxy clean - $(MAKE) -C diagnostics clean - $(MAKE) -C transfused clean - $(MAKE) -C tap-vsockd clean - $(MAKE) -C docker clean - $(MAKE) -C hvtools clean - $(MAKE) -C nc-vsock clean - $(MAKE) -C vsudd clean - $(MAKE) -C 9pmount-vsock clean - $(MAKE) -C iptables clean + for f in $(DEPS); do $(MAKE) -C $$f clean; done From 276157a769a5d57a2ae465c142cee9e73d8cd557 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 21:29:28 +0100 Subject: [PATCH 22/55] Move all output to the directories it will be in eventually Signed-off-by: Justin Cormack --- alpine/Dockerfile | 35 ++++++++----------- alpine/packages/9pmount-vsock/.gitignore | 2 +- alpine/packages/9pmount-vsock/Makefile | 5 +-- alpine/packages/diagnostics/Makefile | 8 ++--- .../diagnostics/{ => usr/bin}/diagnostics | 0 alpine/packages/docker/.gitignore | 2 +- alpine/packages/docker/Makefile | 10 +++--- alpine/packages/hvtools/.gitignore | 6 ++-- alpine/packages/hvtools/Makefile | 13 +++---- .../hvtools/{ => sbin}/hv_get_dhcp_info | 0 .../hvtools/{ => sbin}/hv_get_dns_info | 0 .../hvtools/{ => sbin}/hv_set_ifconfig | 0 alpine/packages/iptables/Makefile | 10 +++--- .../mobyconfig/{ => usr/bin}/mobyconfig | 0 .../mobyplatform/{ => usr/bin}/mobyplatform | 0 alpine/packages/nc-vsock/.gitignore | 2 +- alpine/packages/nc-vsock/Makefile | 7 ++-- alpine/packages/proxy/.gitignore | 2 ++ alpine/packages/proxy/Makefile | 12 +++++-- alpine/packages/tap-vsockd/.gitignore | 2 +- alpine/packages/tap-vsockd/Makefile | 7 ++-- alpine/packages/test/{ => usr/bin}/mobytest | 0 alpine/packages/transfused/.gitignore | 2 +- alpine/packages/transfused/Makefile | 7 ++-- alpine/packages/vsudd/.gitignore | 2 +- alpine/packages/vsudd/Makefile | 5 +-- 26 files changed, 75 insertions(+), 64 deletions(-) rename alpine/packages/diagnostics/{ => usr/bin}/diagnostics (100%) rename alpine/packages/hvtools/{ => sbin}/hv_get_dhcp_info (100%) rename alpine/packages/hvtools/{ => sbin}/hv_get_dns_info (100%) rename alpine/packages/hvtools/{ => sbin}/hv_set_ifconfig (100%) rename alpine/packages/mobyconfig/{ => usr/bin}/mobyconfig (100%) rename alpine/packages/mobyplatform/{ => usr/bin}/mobyplatform (100%) rename alpine/packages/test/{ => usr/bin}/mobytest (100%) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 21103cb75..cc8026c4c 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -16,40 +16,35 @@ COPY kernel/$ARCH/kernel-source-info /etc/ ADD kernel/$ARCH/kernel-patches.tar /etc/kernel-patches ADD kernel/$ARCH/kernel-modules.tar / -COPY packages/proxy/proxy /usr/bin/slirp-proxy -COPY packages/proxy/proxy /sbin/proxy-vsockd +COPY packages/proxy/usr /usr/ +COPY packages/proxy/sbin /sbin/ COPY packages/proxy/etc /etc/ -COPY packages/transfused/transfused /sbin/ +COPY packages/transfused/sbin /sbin/ COPY packages/transfused/etc /etc/ -COPY packages/tap-vsockd/tap-vsockd /sbin/ +COPY packages/tap-vsockd/sbin /sbin/ COPY packages/tap-vsockd/etc /etc/ -COPY packages/docker/bin/* /usr/bin/ +COPY packages/docker/usr /usr/ COPY packages/docker/etc /etc/ -COPY packages/diagnostics/diagnostics /usr/bin/ -COPY packages/diagnostics/diagnostics-server /usr/bin/ +COPY packages/diagnostics/usr /usr/ COPY packages/diagnostics/etc /etc/ COPY packages/automount/etc /etc/ COPY packages/binfmt_misc/etc /etc/ COPY packages/hostsettings/etc /etc/ -COPY packages/hvtools/hv_kvp_daemon /sbin/ -COPY packages/hvtools/hv_vss_daemon /sbin/ +COPY packages/hvtools/sbin /sbin/ COPY packages/hvtools/etc /etc/ -COPY packages/hvtools/hv_get_dhcp_info /sbin/ -COPY packages/hvtools/hv_get_dns_info /sbin/ -COPY packages/hvtools/hv_set_ifconfig /sbin/ -COPY packages/hvtools/hvtools.tar.gz /usr/share/src/ +COPY packages/hvtools/usr /usr/ COPY packages/chronyd/etc /etc/ COPY packages/userns/etc /etc/ -#COPY packages/nc-vsock/nc-vsock /usr/bin/ -COPY packages/vsudd/vsudd /sbin/ +COPY packages/nc-vsock/usr /usr/ +COPY packages/vsudd/sbin /sbin/ COPY packages/vsudd/etc /etc/ -COPY packages/mobyconfig/mobyconfig /usr/bin/ -COPY packages/mobyplatform/mobyplatform /usr/bin/ +COPY packages/mobyconfig/usr /usr/ +COPY packages/mobyplatform/usr /usr/ COPY packages/oom/etc /etc/ -COPY packages/9pmount-vsock/9pmount-vsock /sbin/ +COPY packages/9pmount-vsock/sbin /sbin/ COPY packages/test/etc /etc/ -COPY packages/test/mobytest /usr/bin/ -COPY packages/iptables/iptables /usr/local/sbin/ +COPY packages/test/usr /usr/ +COPY packages/iptables/usr /usr/ COPY packages/containerd/etc /etc/ COPY packages/aws/etc /etc/ COPY packages/azure/etc /etc/ diff --git a/alpine/packages/9pmount-vsock/.gitignore b/alpine/packages/9pmount-vsock/.gitignore index 96331e6d1..5b42612bc 100644 --- a/alpine/packages/9pmount-vsock/.gitignore +++ b/alpine/packages/9pmount-vsock/.gitignore @@ -1 +1 @@ -9pmount-vsock +sbin/ diff --git a/alpine/packages/9pmount-vsock/Makefile b/alpine/packages/9pmount-vsock/Makefile index 595a82e92..7d9d06b35 100644 --- a/alpine/packages/9pmount-vsock/Makefile +++ b/alpine/packages/9pmount-vsock/Makefile @@ -1,8 +1,9 @@ DEPS=Dockerfile $(wildcard *.c *.h) 9pmount-vsock: $(DEPS) + mkdir -p sbin tar cf - $(DEPS) | docker build -t 9pmount-vsock:build - - docker run --rm --net=none 9pmount-vsock:build | tar xf - + docker run --rm --net=none 9pmount-vsock:build | tar xf - -C sbin clean: - rm -f 9pmount-vsock + rm -rf sbin diff --git a/alpine/packages/diagnostics/Makefile b/alpine/packages/diagnostics/Makefile index 0175bf55e..f2d5d6749 100644 --- a/alpine/packages/diagnostics/Makefile +++ b/alpine/packages/diagnostics/Makefile @@ -1,15 +1,15 @@ -all: diagnostics-server +all: usr/bin/diagnostics-server files: ls Dockerfile *.go > files printf -- '-C\n..\n' >> files (cd .. && find vendor) >> files -diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files +usr/bin/diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files tar cf - -T files | docker build -t diagnostics-server:build - - docker run --rm --net=none diagnostics-server:build | tar xf - + docker run --rm --net=none diagnostics-server:build | tar xf - -C usr/bin clean: - rm -rf diagnostics-server files + rm -f usr/bin/diagnostics-server files .DELETE_ON_ERROR: diff --git a/alpine/packages/diagnostics/diagnostics b/alpine/packages/diagnostics/usr/bin/diagnostics similarity index 100% rename from alpine/packages/diagnostics/diagnostics rename to alpine/packages/diagnostics/usr/bin/diagnostics diff --git a/alpine/packages/docker/.gitignore b/alpine/packages/docker/.gitignore index e660fd93d..1b91047ac 100644 --- a/alpine/packages/docker/.gitignore +++ b/alpine/packages/docker/.gitignore @@ -1 +1 @@ -bin/ +usr/ diff --git a/alpine/packages/docker/Makefile b/alpine/packages/docker/Makefile index e9d279d6a..fe2ec2903 100644 --- a/alpine/packages/docker/Makefile +++ b/alpine/packages/docker/Makefile @@ -3,14 +3,14 @@ ARCH?=x86_64 OS?=Linux DOCKER_EXPERIMENTAL?=1 -all: bin/docker +all: usr/bin/docker TEST_HOST=$(shell if echo "$(DOCKER_VERSION)" | grep -q -- '-rc'; then echo "test.docker.com"; else echo "get.docker.com"; fi) DOCKER_HOST?=$(shell [ "${DOCKER_EXPERIMENTAL}" -eq 1 ] && printf "experimental.docker.com" || printf "${TEST_HOST}") DOCKER_BIN_URL?="https://${DOCKER_HOST}/builds/${OS}/${ARCH}/docker-${DOCKER_VERSION}.tgz" -bin/docker: - mkdir -p bin +usr/bin/docker: + mkdir -p usr/bin curl -sSL ${DOCKER_BIN_URL} | tar xzf - && \ mv docker/docker-containerd-ctr \ docker/docker \ @@ -19,9 +19,9 @@ bin/docker: docker/docker-proxy \ docker/docker-runc \ docker/docker-containerd-shim \ - bin/ + usr/bin/ clean: - rm -rf bin/ docker/ + rm -rf usr/ docker/ .DELETE_ON_ERROR: diff --git a/alpine/packages/hvtools/.gitignore b/alpine/packages/hvtools/.gitignore index c69db8318..cf40cde3b 100644 --- a/alpine/packages/hvtools/.gitignore +++ b/alpine/packages/hvtools/.gitignore @@ -1,4 +1,2 @@ -/hv_fcopy_daemon -/hv_kvp_daemon -/hv_vss_daemon -/hvtools.tar.gz +sbin/ +usr/ diff --git a/alpine/packages/hvtools/Makefile b/alpine/packages/hvtools/Makefile index 67efe1d72..936858ccb 100644 --- a/alpine/packages/hvtools/Makefile +++ b/alpine/packages/hvtools/Makefile @@ -1,13 +1,14 @@ -all: hv_fcopy_daemon hvtools.tar.gz +all: sbin/hv_fcopy_daemon usr/share/src/hvtools.tar.gz -hv_fcopy_daemon: Dockerfile src/* +sbin/hv_fcopy_daemon: Dockerfile src/* tar cf - Dockerfile src | docker build -t hvtools:build - - docker run --rm --net=none hvtools:build | tar xf - + docker run --rm --net=none hvtools:build | tar xf - -C sbin -hvtools.tar.gz: src/* - tar czf hvtools.tar.gz src +usr/share/src/hvtools.tar.gz: src/* + mkdir -p usr/share/src/ + tar czf usr/share/src/hvtools.tar.gz src clean: - rm -f hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon hvtools.tar.gz + rm -rf usr sbin/hv_fcopy_daemon sbin/hv_kvp_daemon sbin/hv_vss_daemon .DELETE_ON_ERROR: diff --git a/alpine/packages/hvtools/hv_get_dhcp_info b/alpine/packages/hvtools/sbin/hv_get_dhcp_info similarity index 100% rename from alpine/packages/hvtools/hv_get_dhcp_info rename to alpine/packages/hvtools/sbin/hv_get_dhcp_info diff --git a/alpine/packages/hvtools/hv_get_dns_info b/alpine/packages/hvtools/sbin/hv_get_dns_info similarity index 100% rename from alpine/packages/hvtools/hv_get_dns_info rename to alpine/packages/hvtools/sbin/hv_get_dns_info diff --git a/alpine/packages/hvtools/hv_set_ifconfig b/alpine/packages/hvtools/sbin/hv_set_ifconfig similarity index 100% rename from alpine/packages/hvtools/hv_set_ifconfig rename to alpine/packages/hvtools/sbin/hv_set_ifconfig diff --git a/alpine/packages/iptables/Makefile b/alpine/packages/iptables/Makefile index df248cc0a..607050e5c 100644 --- a/alpine/packages/iptables/Makefile +++ b/alpine/packages/iptables/Makefile @@ -1,9 +1,11 @@ -all: iptables +all: usr/local/sbin/iptables -iptables: Dockerfile main.ml +usr/local/sbin/iptables: Dockerfile main.ml + mkdir -p usr/local/sbin docker build -t iptables:build . - docker run --rm iptables:build cat /app/iptables > iptables - chmod 755 iptables + docker run --rm iptables:build cat /app/iptables > usr/local/sbin/iptables + chmod 755 usr/local/sbin/iptables clean: + rm -rf usr docker images -q iptables:build | xargs docker rmi -f || true diff --git a/alpine/packages/mobyconfig/mobyconfig b/alpine/packages/mobyconfig/usr/bin/mobyconfig similarity index 100% rename from alpine/packages/mobyconfig/mobyconfig rename to alpine/packages/mobyconfig/usr/bin/mobyconfig diff --git a/alpine/packages/mobyplatform/mobyplatform b/alpine/packages/mobyplatform/usr/bin/mobyplatform similarity index 100% rename from alpine/packages/mobyplatform/mobyplatform rename to alpine/packages/mobyplatform/usr/bin/mobyplatform diff --git a/alpine/packages/nc-vsock/.gitignore b/alpine/packages/nc-vsock/.gitignore index 41edd196d..1b91047ac 100644 --- a/alpine/packages/nc-vsock/.gitignore +++ b/alpine/packages/nc-vsock/.gitignore @@ -1 +1 @@ -nc-vsock +usr/ diff --git a/alpine/packages/nc-vsock/Makefile b/alpine/packages/nc-vsock/Makefile index 0bc2d2d1b..cf9752ee6 100644 --- a/alpine/packages/nc-vsock/Makefile +++ b/alpine/packages/nc-vsock/Makefile @@ -1,8 +1,9 @@ DEPS=Dockerfile $(wildcard *.c *.h) -nc-vsock: $(DEPS) +usr/bin/nc-vsock: $(DEPS) + mkdir -p usr/bin tar cf - $(DEPS) | docker build -t nc-vsock:build - - docker run --rm --net=none nc-vsock:build | tar xf - + docker run --rm --net=none nc-vsock:build | tar xf - -C usr/bin clean: - rm -f nc-vsock + rm -rf usr diff --git a/alpine/packages/proxy/.gitignore b/alpine/packages/proxy/.gitignore index 20e175582..943135763 100644 --- a/alpine/packages/proxy/.gitignore +++ b/alpine/packages/proxy/.gitignore @@ -1,2 +1,4 @@ proxy files +usr/ +sbin/ diff --git a/alpine/packages/proxy/Makefile b/alpine/packages/proxy/Makefile index df1f82903..c676cd4ee 100644 --- a/alpine/packages/proxy/Makefile +++ b/alpine/packages/proxy/Makefile @@ -1,4 +1,4 @@ -all: proxy +all: usr/bin/slirp-proxy sbin/proxy-vsockd files: ls Dockerfile *.go > files @@ -10,7 +10,15 @@ proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../vendor/manifest files tar cf - -T files | docker build -t proxy:build - docker run --rm --net=none proxy:build | tar xf - +usr/bin/slirp-proxy: proxy + mkdir -p usr/bin + cp proxy $@ + +sbin/proxy-vsockd: proxy + mkdir -p sbin + cp proxy $@ + clean: - rm -rf proxy files + rm -rf proxy files sbin usr .DELETE_ON_ERROR: diff --git a/alpine/packages/tap-vsockd/.gitignore b/alpine/packages/tap-vsockd/.gitignore index 5cf0d45b4..e1ae85e07 100644 --- a/alpine/packages/tap-vsockd/.gitignore +++ b/alpine/packages/tap-vsockd/.gitignore @@ -1 +1 @@ -tap-vsockd +sbin diff --git a/alpine/packages/tap-vsockd/Makefile b/alpine/packages/tap-vsockd/Makefile index 5b330c4f6..9fb44a613 100644 --- a/alpine/packages/tap-vsockd/Makefile +++ b/alpine/packages/tap-vsockd/Makefile @@ -1,8 +1,9 @@ DEPS=Dockerfile $(wildcard *.c *.h) -tap-vsockd: $(DEPS) +sbin/tap-vsockd: $(DEPS) + mkdir -p sbin tar cf - $(DEPS) | docker build -t tap-vsockd:build - - docker run --rm --net=none tap-vsockd:build | tar xf - + docker run --rm --net=none tap-vsockd:build | tar xf - -C sbin clean: - rm -f tap-vsockd + rm -rf sbin diff --git a/alpine/packages/test/mobytest b/alpine/packages/test/usr/bin/mobytest similarity index 100% rename from alpine/packages/test/mobytest rename to alpine/packages/test/usr/bin/mobytest diff --git a/alpine/packages/transfused/.gitignore b/alpine/packages/transfused/.gitignore index 497a34c5f..e1ae85e07 100644 --- a/alpine/packages/transfused/.gitignore +++ b/alpine/packages/transfused/.gitignore @@ -1 +1 @@ -/transfused +sbin diff --git a/alpine/packages/transfused/Makefile b/alpine/packages/transfused/Makefile index 34e1e57f0..804d30f80 100644 --- a/alpine/packages/transfused/Makefile +++ b/alpine/packages/transfused/Makefile @@ -1,8 +1,9 @@ DEPS=Dockerfile $(wildcard *.c *.h) -transfused: $(DEPS) +sbin/transfused: $(DEPS) + mkdir -p sbin tar cf - $(DEPS) | docker build -t transfused:build - - docker run --rm --net=none transfused:build | tar xf - + docker run --rm --net=none transfused:build | tar xf - -C sbin clean: - rm -f transfused + rm -rf sbin diff --git a/alpine/packages/vsudd/.gitignore b/alpine/packages/vsudd/.gitignore index 03530f774..e7258a57d 100644 --- a/alpine/packages/vsudd/.gitignore +++ b/alpine/packages/vsudd/.gitignore @@ -1,2 +1,2 @@ -vsudd files +sbin/ diff --git a/alpine/packages/vsudd/Makefile b/alpine/packages/vsudd/Makefile index 2313c1cf2..66cd1389d 100644 --- a/alpine/packages/vsudd/Makefile +++ b/alpine/packages/vsudd/Makefile @@ -6,10 +6,11 @@ files: (cd .. && find vendor) >> files vsudd: Dockerfile $(wildcard *.go) ../vendor/manifest files + mkdir -p sbin tar cf - -T files | docker build -t vsudd:build - - docker run --rm --net=none vsudd:build | tar xf - + docker run --rm --net=none vsudd:build | tar xf - -C sbin clean: - rm -rf vsudd files + rm -rf sbin files .DELETE_ON_ERROR: From 1b487549bb4693c7c6f9c59c5390c5ec924599f6 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 21:43:18 +0100 Subject: [PATCH 23/55] use tar for iptables Signed-off-by: Justin Cormack --- alpine/packages/iptables/Dockerfile | 1 + alpine/packages/iptables/Makefile | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/packages/iptables/Dockerfile b/alpine/packages/iptables/Dockerfile index 6c6ea1b3e..9b09fea1e 100644 --- a/alpine/packages/iptables/Dockerfile +++ b/alpine/packages/iptables/Dockerfile @@ -5,3 +5,4 @@ WORKDIR /app ADD . /app RUN sudo chown -R opam /app RUN opam config exec -- ocamlfind ocamlopt -package unix,astring,syslog -linkpkg -o iptables main.ml +CMD ["tar", "cf", "-", "iptables"] diff --git a/alpine/packages/iptables/Makefile b/alpine/packages/iptables/Makefile index 607050e5c..0965a9f7d 100644 --- a/alpine/packages/iptables/Makefile +++ b/alpine/packages/iptables/Makefile @@ -3,8 +3,7 @@ all: usr/local/sbin/iptables usr/local/sbin/iptables: Dockerfile main.ml mkdir -p usr/local/sbin docker build -t iptables:build . - docker run --rm iptables:build cat /app/iptables > usr/local/sbin/iptables - chmod 755 usr/local/sbin/iptables + docker run --rm iptables:build | tar xf - -C usr/local/sbin clean: rm -rf usr From b605c70ce5384f72f0595d15017ecaad0f60b880 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 21:50:50 +0100 Subject: [PATCH 24/55] move mkinitrd to / Signed-off-by: Justin Cormack --- alpine/Dockerfile | 2 +- alpine/Makefile | 2 +- alpine/mkinitrd.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index cc8026c4c..80ac654e8 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -11,7 +11,6 @@ COPY etc /etc/ RUN mkdir -p /etc/docker ADD kernel/$ARCH/aufs-utils.tar / -COPY mkinitrd.sh /bin/ COPY kernel/$ARCH/kernel-source-info /etc/ ADD kernel/$ARCH/kernel-patches.tar /etc/kernel-patches ADD kernel/$ARCH/kernel-modules.tar / @@ -90,6 +89,7 @@ RUN \ true COPY init / +COPY mkinitrd.sh / RUN adduser -D -H -s /sbin/nologin dockremap diff --git a/alpine/Makefile b/alpine/Makefile index daa853b9b..efc0c5c1d 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -8,7 +8,7 @@ initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) $(MAKE) -j -C packages $(MAKE) -C kernel docker build -t moby-initrd:build . - docker run --net=none --rm moby-initrd:build /bin/mkinitrd.sh > $@ + docker run --net=none --rm moby-initrd:build /mkinitrd.sh > $@ initrd.img.gz: initrd.img cat initrd.img | gzip -9 > initrd.img.gz diff --git a/alpine/mkinitrd.sh b/alpine/mkinitrd.sh index bb23c3b0d..894b080de 100755 --- a/alpine/mkinitrd.sh +++ b/alpine/mkinitrd.sh @@ -32,7 +32,7 @@ EOF printf 'moby' > /tmp/etc/hostname -rm /tmp/bin/mkinitrd.sh +rm /tmp/mkinitrd.sh cd /tmp find . | cpio -H newc -o From 5c634808df7ece851d39feddee4b4ea812d6293f Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sat, 10 Sep 2016 23:31:42 +0100 Subject: [PATCH 25/55] simplify tar for vendor directory Signed-off-by: Justin Cormack --- alpine/packages/diagnostics/.gitignore | 3 +-- alpine/packages/diagnostics/Makefile | 11 ++++------- alpine/packages/proxy/.gitignore | 1 - alpine/packages/proxy/Makefile | 12 ++++-------- alpine/packages/vsudd/.gitignore | 1 - alpine/packages/vsudd/Makefile | 11 ++++------- 6 files changed, 13 insertions(+), 26 deletions(-) diff --git a/alpine/packages/diagnostics/.gitignore b/alpine/packages/diagnostics/.gitignore index 826049f6e..bb212fdf6 100644 --- a/alpine/packages/diagnostics/.gitignore +++ b/alpine/packages/diagnostics/.gitignore @@ -1,2 +1 @@ -diagnostics-server -files +usr/bin/diagnostics-server diff --git a/alpine/packages/diagnostics/Makefile b/alpine/packages/diagnostics/Makefile index f2d5d6749..6be88f03e 100644 --- a/alpine/packages/diagnostics/Makefile +++ b/alpine/packages/diagnostics/Makefile @@ -1,15 +1,12 @@ all: usr/bin/diagnostics-server -files: - ls Dockerfile *.go > files - printf -- '-C\n..\n' >> files - (cd .. && find vendor) >> files +DEPS=Dockerfile $(wildcard *.go) -usr/bin/diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files - tar cf - -T files | docker build -t diagnostics-server:build - +usr/bin/diagnostics-server: $(DEPS) ../vendor/manifest + tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t diagnostics-server:build - docker run --rm --net=none diagnostics-server:build | tar xf - -C usr/bin clean: - rm -f usr/bin/diagnostics-server files + rm -f usr/bin/diagnostics-server .DELETE_ON_ERROR: diff --git a/alpine/packages/proxy/.gitignore b/alpine/packages/proxy/.gitignore index 943135763..5ae715395 100644 --- a/alpine/packages/proxy/.gitignore +++ b/alpine/packages/proxy/.gitignore @@ -1,4 +1,3 @@ proxy -files usr/ sbin/ diff --git a/alpine/packages/proxy/Makefile b/alpine/packages/proxy/Makefile index c676cd4ee..d4a54051d 100644 --- a/alpine/packages/proxy/Makefile +++ b/alpine/packages/proxy/Makefile @@ -1,13 +1,9 @@ all: usr/bin/slirp-proxy sbin/proxy-vsockd -files: - ls Dockerfile *.go > files - find libproxy >> files - printf -- '-C\n..\n' >> files - (cd .. && find vendor) >> files +DEPS=Dockerfile $(wildcard *.go libproxy/*.go) -proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../vendor/manifest files - tar cf - -T files | docker build -t proxy:build - +proxy: $(DEPS) ../vendor/manifest + tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t proxy:build - docker run --rm --net=none proxy:build | tar xf - usr/bin/slirp-proxy: proxy @@ -19,6 +15,6 @@ sbin/proxy-vsockd: proxy cp proxy $@ clean: - rm -rf proxy files sbin usr + rm -rf proxy sbin usr .DELETE_ON_ERROR: diff --git a/alpine/packages/vsudd/.gitignore b/alpine/packages/vsudd/.gitignore index e7258a57d..5b42612bc 100644 --- a/alpine/packages/vsudd/.gitignore +++ b/alpine/packages/vsudd/.gitignore @@ -1,2 +1 @@ -files sbin/ diff --git a/alpine/packages/vsudd/Makefile b/alpine/packages/vsudd/Makefile index 66cd1389d..93c3dec0a 100644 --- a/alpine/packages/vsudd/Makefile +++ b/alpine/packages/vsudd/Makefile @@ -1,16 +1,13 @@ all: vsudd -files: - ls Dockerfile *.go > files - printf -- '-C\n..\n' >> files - (cd .. && find vendor) >> files +DEPS=Dockerfile $(wildcard *.go) -vsudd: Dockerfile $(wildcard *.go) ../vendor/manifest files +vsudd: $(DEPS) ../vendor/manifest mkdir -p sbin - tar cf - -T files | docker build -t vsudd:build - + tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t vsudd:build - docker run --rm --net=none vsudd:build | tar xf - -C sbin clean: - rm -rf sbin files + rm -rf sbin .DELETE_ON_ERROR: From b392bf0a2ee555ecab60e998021621f5ebbc23e2 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 00:05:31 +0100 Subject: [PATCH 26/55] Simplify kernel output and main Dockerfile Signed-off-by: Justin Cormack --- alpine/.dockerignore | 1 - alpine/Dockerfile | 26 +++++++------------ alpine/kernel/.gitignore | 7 +++-- alpine/kernel/Dockerfile | 5 +--- alpine/kernel/Makefile | 20 ++++++-------- .../packages/containerd/etc/init.d/containerd | 8 ++++++ alpine/packages/docker/etc/init.d/docker | 1 + 7 files changed, 32 insertions(+), 36 deletions(-) delete mode 100644 alpine/.dockerignore diff --git a/alpine/.dockerignore b/alpine/.dockerignore deleted file mode 100644 index fdb1349b5..000000000 --- a/alpine/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -packages/docker/docker.git diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 80ac654e8..45eac5aea 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -5,15 +5,18 @@ ENV ARCH=x86_64 RUN \ addgroup -g 50 docker && \ adduser -G docker -u 1001 -s /bin/sh -D -g "Docker" docker && \ - passwd -d root + passwd -d root && \ + adduser -D -H -s /sbin/nologin dockremap COPY etc /etc/ -RUN mkdir -p /etc/docker -ADD kernel/$ARCH/aufs-utils.tar / -COPY kernel/$ARCH/kernel-source-info /etc/ -ADD kernel/$ARCH/kernel-patches.tar /etc/kernel-patches -ADD kernel/$ARCH/kernel-modules.tar / +COPY kernel/usr /usr/ +COPY kernel/etc /etc/ +COPY kernel/sbin /sbin/ +COPY kernel/lib /lib/ + +COPY init / +COPY mkinitrd.sh / COPY packages/proxy/usr /usr/ COPY packages/proxy/sbin /sbin/ @@ -88,15 +91,4 @@ RUN \ rc-update add azure default && \ true -COPY init / -COPY mkinitrd.sh / - -RUN adduser -D -H -s /sbin/nologin dockremap - -RUN cd /usr/bin && \ - ln -s docker-runc runc && \ - ln -s docker-containerd-shim containerd-shim && \ - ln -s docker-containerd-ctr containerd-ctr && \ - ln -s docker-containerd containerd - CMD ["/bin/sh"] diff --git a/alpine/kernel/.gitignore b/alpine/kernel/.gitignore index a4129c97c..fea831687 100644 --- a/alpine/kernel/.gitignore +++ b/alpine/kernel/.gitignore @@ -1,2 +1,5 @@ -x86_64 -arm +x86_64/ +etc/ +lib/ +usr/ +sbin/ diff --git a/alpine/kernel/Dockerfile b/alpine/kernel/Dockerfile index 944d8ec04..fa4e5657c 100644 --- a/alpine/kernel/Dockerfile +++ b/alpine/kernel/Dockerfile @@ -66,13 +66,10 @@ RUN if [ $DEBUG -ne "0" ]; then \ # Apply local patches COPY patches /patches RUN cd /linux && \ - mkdir /etc/kernel-patches && \ set -e && for patch in /patches/*.patch; do \ echo "Applying $patch"; \ - cp "$patch" /etc/kernel-patches; \ patch -p1 < "$patch"; \ - done && \ - cd /etc/kernel-patches && tar cf /kernel-patches.tar . + done RUN jobs=$(nproc); \ cd /linux && \ diff --git a/alpine/kernel/Makefile b/alpine/kernel/Makefile index 739db4e2b..1bf53e271 100644 --- a/alpine/kernel/Makefile +++ b/alpine/kernel/Makefile @@ -8,21 +8,17 @@ $(ARCH)/mobykernel-build: Dockerfile kernel_config docker build --build-arg DEBUG=$(DEBUG) -t mobykernel:build . touch $@ -$(ARCH)/aufs-utils.tar $(ARCH)/kernel-source-info $(ARCH)/kernel-patches.tar $(ARCH)/kernel-modules.tar: $(ARCH)/mobykernel-build - docker run --rm mobykernel:build cat /$(notdir $@) > $@ || ! rm $@ - -$(ARCH)/bzImage $(ARCH)/zImage: $(ARCH)/aufs-utils.tar $(ARCH)/kernel-source-info $(ARCH)/kernel-patches.tar $(ARCH)/kernel-modules.tar $(ARCH)/mobykernel-build +$(ARCH)/bzImage: $(ARCH)/mobykernel-build docker run --rm mobykernel:build cat /linux/arch/$(ARCH)/boot/$(notdir $@) > $@ || ! rm $@ - -$(ARCH)/vmlinux: $(ARCH)/bzImage - docker run --rm mobykernel:build cat /linux/vmlinux > $@ || ! rm $@ + docker run --rm --net=none mobykernel:build cat /kernel-modules.tar | tar xf - + docker run --rm mobykernel:build cat /aufs-utils.tar | tar xf - + docker run --rm mobykernel:build cat /kernel-source-info > etc/kernel-source-info + mkdir -p etc + cp -a patches etc/kernel-patches $(ARCH)/vmlinuz64: $(ARCH)/bzImage cp $< $@ -clean-arch: - rm -rf $(ARCH) - docker images -q mobykernel:build | xargs docker rmi -f || true - clean: - $(MAKE) clean-arch ARCH=x86_64 + rm -rf $(ARCH) lib etc usr sbin + docker images -q mobykernel:build | xargs docker rmi -f || true diff --git a/alpine/packages/containerd/etc/init.d/containerd b/alpine/packages/containerd/etc/init.d/containerd index f5b007d41..60fd8ae88 100755 --- a/alpine/packages/containerd/etc/init.d/containerd +++ b/alpine/packages/containerd/etc/init.d/containerd @@ -13,6 +13,14 @@ start() ulimit -n 1048576 ulimit -p unlimited + [ ! -e /usr/bin/containerd ] && \ + ( cd /usr/bin && \ + ln -s docker-runc runc && \ + ln -s docker-containerd-shim containerd-shim && \ + ln -s docker-containerd-ctr containerd-ctr && \ + ln -s docker-containerd containerd \ + ) + /usr/bin/containerd 1>&2 2>/var/log/containerd.log & ewaitfile 5 /var/run/containerd/containerd.sock diff --git a/alpine/packages/docker/etc/init.d/docker b/alpine/packages/docker/etc/init.d/docker index 81ee9b35c..38f67e2cb 100755 --- a/alpine/packages/docker/etc/init.d/docker +++ b/alpine/packages/docker/etc/init.d/docker @@ -41,6 +41,7 @@ start() esac # some config is always in /etc/docker cannot specify alternative eg certs + mkdir -p /etc/docker if mobyconfig exists etc/docker then for f in $(mobyconfig find etc/docker) From 347328f348a41e1938f3f92e329be7e9811d3e30 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 00:10:17 +0100 Subject: [PATCH 27/55] clean up main Dockerfile and Makefile to use exact correct context, tar input Signed-off-by: Justin Cormack --- alpine/Dockerfile | 44 ++------------------------------------------ alpine/Makefile | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 43 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 45eac5aea..3e8b0c39a 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -8,48 +8,8 @@ RUN \ passwd -d root && \ adduser -D -H -s /sbin/nologin dockremap -COPY etc /etc/ - -COPY kernel/usr /usr/ -COPY kernel/etc /etc/ -COPY kernel/sbin /sbin/ -COPY kernel/lib /lib/ - -COPY init / -COPY mkinitrd.sh / - -COPY packages/proxy/usr /usr/ -COPY packages/proxy/sbin /sbin/ -COPY packages/proxy/etc /etc/ -COPY packages/transfused/sbin /sbin/ -COPY packages/transfused/etc /etc/ -COPY packages/tap-vsockd/sbin /sbin/ -COPY packages/tap-vsockd/etc /etc/ -COPY packages/docker/usr /usr/ -COPY packages/docker/etc /etc/ -COPY packages/diagnostics/usr /usr/ -COPY packages/diagnostics/etc /etc/ -COPY packages/automount/etc /etc/ -COPY packages/binfmt_misc/etc /etc/ -COPY packages/hostsettings/etc /etc/ -COPY packages/hvtools/sbin /sbin/ -COPY packages/hvtools/etc /etc/ -COPY packages/hvtools/usr /usr/ -COPY packages/chronyd/etc /etc/ -COPY packages/userns/etc /etc/ -COPY packages/nc-vsock/usr /usr/ -COPY packages/vsudd/sbin /sbin/ -COPY packages/vsudd/etc /etc/ -COPY packages/mobyconfig/usr /usr/ -COPY packages/mobyplatform/usr /usr/ -COPY packages/oom/etc /etc/ -COPY packages/9pmount-vsock/sbin /sbin/ -COPY packages/test/etc /etc/ -COPY packages/test/usr /usr/ -COPY packages/iptables/usr /usr/ -COPY packages/containerd/etc /etc/ -COPY packages/aws/etc /etc/ -COPY packages/azure/etc /etc/ +COPY . . +RUN rm Dockerfile RUN \ rc-update add swap boot && \ diff --git a/alpine/Makefile b/alpine/Makefile index efc0c5c1d..950136ea0 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -7,7 +7,33 @@ initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) rm -f initrd.img $(MAKE) -j -C packages $(MAKE) -C kernel - docker build -t moby-initrd:build . + tar cf - \ + Dockerfile etc init mkinitrd.sh \ + -C kernel usr etc sbin lib -C .. \ + -C packages/proxy usr sbin etc -C ../.. \ + -C packages/transfused sbin etc -C ../.. \ + -C packages/tap-vsockd sbin etc -C ../.. \ + -C packages/docker usr etc -C ../.. \ + -C packages/diagnostics usr etc -C ../.. \ + -C packages/automount etc -C ../.. \ + -C packages/binfmt_misc etc -C ../.. \ + -C packages/hostsettings etc -C ../.. \ + -C packages/hvtools sbin etc usr -C ../.. \ + -C packages/chronyd etc -C ../.. \ + -C packages/userns etc -C ../.. \ + -C packages/nc-vsock usr -C ../.. \ + -C packages/vsudd sbin etc -C ../.. \ + -C packages/mobyconfig usr -C ../.. \ + -C packages/mobyplatform usr -C ../.. \ + -C packages/oom etc -C ../.. \ + -C packages/9pmount-vsock sbin -C ../.. \ + -C packages/test etc usr -C ../.. \ + -C packages/iptables usr -C ../.. \ + -C packages/containerd etc -C ../.. \ + -C packages/aws etc -C ../.. \ + -C packages/azure etc -C ../.. \ + | \ + docker build -t moby-initrd:build - docker run --net=none --rm moby-initrd:build /mkinitrd.sh > $@ initrd.img.gz: initrd.img From c498f7ac23fb59ec2d0cbaf0330ddcf6ebc7dada Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 00:16:06 +0100 Subject: [PATCH 28/55] remove broken arm functionality - will rework Signed-off-by: Justin Cormack --- Makefile | 8 -------- alpine/Makefile | 34 +++------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index 9114c5b9b..b8ec4b5de 100644 --- a/Makefile +++ b/Makefile @@ -12,14 +12,6 @@ qemu-iso: all docker build -f Dockerfile.qemuiso -t mobyqemuiso:build . docker run -it --rm mobyqemuiso:build -arm: - $(MAKE) -C alpine/kernel arm - $(MAKE) -C alpine arm - -qemu-arm: Dockerfile.qemu.armhf arm - docker build -f Dockerfile.qemu.armhf -t mobyarmqemu:build . - docker run -it --rm mobyarmqemu:build - test: Dockerfile.test all tar cf - Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 | \ docker build -f Dockerfile.test -t mobytest:build - diff --git a/alpine/Makefile b/alpine/Makefile index 950136ea0..41cce6627 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -3,10 +3,7 @@ all: initrd.img.gz mobylinux-efi.iso ETCFILES=etc/issue etc/motd etc/network/interfaces ETCFILES+=etc/inittab etc/fstab -initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) - rm -f initrd.img - $(MAKE) -j -C packages - $(MAKE) -C kernel +initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) common tar cf - \ Dockerfile etc init mkinitrd.sh \ -C kernel usr etc sbin lib -C .. \ @@ -48,33 +45,9 @@ mobylinux-bios.iso: initrd.img Dockerfile.bios isolinux.cfg docker build -t moby-bios:build -f Dockerfile.bios . docker run --net=none --rm moby-bios:build cat /tmp/mobylinux-bios.iso > $@ -arm: initrd-arm.img - -Dockerfile.armhf: Dockerfile - cat Dockerfile | \ - sed 's@FROM alpine@FROM justincormack/armhf-alpine@' | \ - sed '/hv_/d' | \ - sed '/hvtools/d' | \ - sed 's/syslinux//' | \ - sed '/proxy/d' | \ - sed '/diagnostics/d' | \ - sed '/nc-vsock/d' | \ - sed '/vsudd/d' | \ - sed '/gummiboot/d' | \ - grep -v 'tap-vsockd' | \ - grep -v '9pmount-vsock' | \ - grep -v 'rc-update add binfmt_misc sysinit' > $@ - -initrd-arm.img: Dockerfile.armhf - rm -f initrd-arm.img - $(MAKE) -C packages arm - $(MAKE) -C kernel arm - docker build -t moby-arm:build -f Dockerfile.armhf . - docker run --net=none --rm moby-arm:build /bin/mkinitrd.sh > $@ - common: initrd.img $(MAKE) -C kernel - $(MAKE) -C packages + $(MAKE) -j -C packages ami: common docker-compose build ami @@ -89,11 +62,10 @@ azure: common docker-compose run --rm -T azure uploadvhd clean: - rm -f initrd.img initrd.img.gz initrd-arm.img Dockerfile.armhf mobylinux.vhd mobylinux.img + rm -f initrd.img initrd.img.gz mobylinux.vhd mobylinux.img rm -f mobylinux-bios.iso mobylinux-efi.iso mobylinux.efi docker images -q moby-efi:build | xargs docker rmi -f || true docker images -q moby-bios:build | xargs docker rmi -f || true - docker images -q moby-arm:build | xargs docker rmi -f || true docker images -q alpine_ami:latest | xargs docker rmi -f || true docker images -q alpine_azure:latest | xargs docker rmi -f || true $(MAKE) -C packages clean From 71e33e3a08e1ecaf24b2d30b94fde5a77870742c Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 00:43:00 +0100 Subject: [PATCH 29/55] smaller contexts for efi and bios Signed-off-by: Justin Cormack --- alpine/Dockerfile.bios | 2 +- alpine/Dockerfile.efi | 8 ++------ alpine/Makefile | 8 ++++---- alpine/isolinux.cfg | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/alpine/Dockerfile.bios b/alpine/Dockerfile.bios index 5ab3087cb..c2cf713de 100644 --- a/alpine/Dockerfile.bios +++ b/alpine/Dockerfile.bios @@ -9,7 +9,7 @@ RUN mkdir -p /tmp/iso/isolinux && \ cp /usr/share/syslinux/isolinux.bin /tmp/iso/isolinux && \ cp /usr/share/syslinux/ldlinux.c32 /tmp/iso/isolinux -COPY initrd.img /tmp/iso +COPY initrd.img.gz /tmp/iso COPY kernel/x86_64/vmlinuz64 /tmp/iso COPY isolinux.cfg /tmp/iso/isolinux diff --git a/alpine/Dockerfile.efi b/alpine/Dockerfile.efi index b455880d6..8768f515f 100644 --- a/alpine/Dockerfile.efi +++ b/alpine/Dockerfile.efi @@ -1,14 +1,10 @@ # Create a EFI Bootable ISO FROM alpine:3.4 -ENV ARCH=x86_64 - RUN apk add --no-cache binutils mtools xorriso gummiboot -RUN mkdir -p /tmp/efi - -COPY initrd.img.gz /tmp/efi -COPY kernel/$ARCH/vmlinuz64 /tmp/efi +COPY initrd.img.gz /tmp/efi/ +COPY kernel/x86_64/vmlinuz64 /tmp/efi/ # Create a EFI boot file with kernel and initrd. From: # https://github.com/haraldh/mkrescue-uefi/blob/master/mkrescue-uefi.sh diff --git a/alpine/Makefile b/alpine/Makefile index 41cce6627..d848c9136 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -36,13 +36,13 @@ initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) common initrd.img.gz: initrd.img cat initrd.img | gzip -9 > initrd.img.gz -mobylinux-efi.iso: initrd.img.gz Dockerfile.efi - docker build -t moby-efi:build -f Dockerfile.efi . +mobylinux-efi.iso: Dockerfile.efi initrd.img.gz kernel/x86_64/vmlinuz64 + tar cf - $^ | docker build -t moby-efi:build -f Dockerfile.efi - docker run --net=none --rm --cap-add sys_admin moby-efi:build cat /tmp/efi/mobylinux.efi > mobylinux.efi docker run --net=none --rm --cap-add sys_admin moby-efi:build cat /tmp/efi/mobylinux-efi.iso > $@ -mobylinux-bios.iso: initrd.img Dockerfile.bios isolinux.cfg - docker build -t moby-bios:build -f Dockerfile.bios . +mobylinux-bios.iso: Dockerfile.bios initrd.img.gz kernel/x86_64/vmlinuz64 isolinux.cfg + tar cf - $^ | docker build -t moby-bios:build -f Dockerfile.bios - docker run --net=none --rm moby-bios:build cat /tmp/mobylinux-bios.iso > $@ common: initrd.img diff --git a/alpine/isolinux.cfg b/alpine/isolinux.cfg index 660d27c6c..9c700b21a 100644 --- a/alpine/isolinux.cfg +++ b/alpine/isolinux.cfg @@ -1,5 +1,5 @@ DEFAULT linux LABEL linux KERNEL /vmlinuz64 - INITRD /initrd.img + INITRD /initrd.img.gz APPEND earlyprintk=serial console=ttyS0 console=tty1 From 43ab6520cf7befb951d6a4f15f4a7ebee859db11 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 11:11:46 +0100 Subject: [PATCH 30/55] update to latest alpine base images Signed-off-by: Justin Cormack --- alpine/Dockerfile | 2 +- alpine/packages/9pmount-vsock/Dockerfile | 2 +- alpine/packages/diagnostics/Dockerfile | 2 +- alpine/packages/hvtools/Dockerfile | 2 +- alpine/packages/nc-vsock/Dockerfile | 2 +- alpine/packages/proxy/Dockerfile | 2 +- alpine/packages/tap-vsockd/Dockerfile | 2 +- alpine/packages/transfused/Dockerfile | 2 +- alpine/packages/vsudd/Dockerfile | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 3e8b0c39a..79a38fa98 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-base:77722e15bd14c8de88e2d2a8235bac75ee6187b3 +FROM mobylinux/alpine-base:32042e9cf243f06f9ecb10bfd64e3dd059b9650d ENV ARCH=x86_64 diff --git a/alpine/packages/9pmount-vsock/Dockerfile b/alpine/packages/9pmount-vsock/Dockerfile index 5b5635555..99a8a8e32 100644 --- a/alpine/packages/9pmount-vsock/Dockerfile +++ b/alpine/packages/9pmount-vsock/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b +FROM mobylinux/alpine-build-c:1ea690a7438cdd8a5965eaa034e0a0c521d9cb40 COPY . /9pmount-vsock diff --git a/alpine/packages/diagnostics/Dockerfile b/alpine/packages/diagnostics/Dockerfile index 626759fde..3eea9dba5 100644 --- a/alpine/packages/diagnostics/Dockerfile +++ b/alpine/packages/diagnostics/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2 +FROM mobylinux/alpine-build-go:21b413791b4fed2e16126c77c6b860feaf889d70 COPY ./ /go/src/diagnostics-server/ diff --git a/alpine/packages/hvtools/Dockerfile b/alpine/packages/hvtools/Dockerfile index 5860c29cc..49e8a932a 100644 --- a/alpine/packages/hvtools/Dockerfile +++ b/alpine/packages/hvtools/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b +FROM mobylinux/alpine-build-c:1ea690a7438cdd8a5965eaa034e0a0c521d9cb40 COPY src /hvtools/ diff --git a/alpine/packages/nc-vsock/Dockerfile b/alpine/packages/nc-vsock/Dockerfile index bf27c4854..f93b9fc71 100644 --- a/alpine/packages/nc-vsock/Dockerfile +++ b/alpine/packages/nc-vsock/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b +FROM mobylinux/alpine-build-c:1ea690a7438cdd8a5965eaa034e0a0c521d9cb40 COPY . /nc-vsock diff --git a/alpine/packages/proxy/Dockerfile b/alpine/packages/proxy/Dockerfile index 29091eee0..cea1d15e2 100644 --- a/alpine/packages/proxy/Dockerfile +++ b/alpine/packages/proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2 +FROM mobylinux/alpine-build-go:21b413791b4fed2e16126c77c6b860feaf889d70 COPY ./ /go/src/proxy/ diff --git a/alpine/packages/tap-vsockd/Dockerfile b/alpine/packages/tap-vsockd/Dockerfile index b65017eb1..a8e26bf8e 100644 --- a/alpine/packages/tap-vsockd/Dockerfile +++ b/alpine/packages/tap-vsockd/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b +FROM mobylinux/alpine-build-c:1ea690a7438cdd8a5965eaa034e0a0c521d9cb40 COPY . /tap-vsockd diff --git a/alpine/packages/transfused/Dockerfile b/alpine/packages/transfused/Dockerfile index f075309fe..31b7d80eb 100644 --- a/alpine/packages/transfused/Dockerfile +++ b/alpine/packages/transfused/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b +FROM mobylinux/alpine-build-c:1ea690a7438cdd8a5965eaa034e0a0c521d9cb40 COPY . /transfused diff --git a/alpine/packages/vsudd/Dockerfile b/alpine/packages/vsudd/Dockerfile index 0676ad8f6..ce8227b3f 100644 --- a/alpine/packages/vsudd/Dockerfile +++ b/alpine/packages/vsudd/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2 +FROM mobylinux/alpine-build-go:21b413791b4fed2e16126c77c6b860feaf889d70 COPY ./ /go/src/vsudd/ From 18912fa3b5a9d04f723789d36b8a2105710cd5da Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 11:28:07 +0100 Subject: [PATCH 31/55] do not force rebuild from top level makefile Signed-off-by: Justin Cormack --- Makefile | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index b8ec4b5de..bfa632937 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,28 @@ all: - $(MAKE) -C alpine/kernel $(MAKE) -C alpine -qemu: all - tar cf - Dockerfile.qemu alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 | \ - docker build -f Dockerfile.qemu -t mobyqemu:build - +alpine/initrd.img.gz: + $(MAKE) -C alpine initrd.img.gz + +alpine/kernel/x86_64/vmlinuz64: + $(MAKE) -C alpine/kernel x86_64/vmlinuz64 + +alpine/mobylinux-bios.iso: + $(MAKE) -C alpine mobylinux-bios.iso + +QEMU_DEPS=Dockerfile.qemu alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 +qemu: $(QEMU_DEPS) + tar cf - $(QEMU_DEPS) | docker build -f Dockerfile.qemu -t mobyqemu:build - docker run -it --rm mobyqemu:build -qemu-iso: all - $(MAKE) -C alpine mobylinux-bios.iso - docker build -f Dockerfile.qemuiso -t mobyqemuiso:build . +QEMU_ISO_DEPS=Dockerfile.qemuiso alpine/mobylinux-bios.iso +qemu-iso: $(TEST_DEPS) + tar cf - $(QEMU_ISO_DEPS) | docker build -f Dockerfile.qemuiso -t mobyqemuiso:build - docker run -it --rm mobyqemuiso:build -test: Dockerfile.test all - tar cf - Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 | \ - docker build -f Dockerfile.test -t mobytest:build - +TEST_DEPS=Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 +test: $(TEST_DEPS) + tar cf - $(TEST_DEPS) | docker build -f Dockerfile.test -t mobytest:build - touch test.log docker run --rm mobytest:build 2>&1 | tee -a test.log & tail -f test.log 2>/dev/null | grep -m 1 -q 'Moby test suite ' From af85abc84d5ee3202b0850d75e8f1ad6fd33880e Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 11:54:13 +0100 Subject: [PATCH 32/55] reproducible builds for efi and bios isos Signed-off-by: Justin Cormack --- alpine/Dockerfile.bios | 20 ++++++++----------- alpine/Dockerfile.efi | 17 +++++++--------- alpine/base/alpine-bios/Dockerfile | 8 ++++++++ alpine/base/alpine-bios/Makefile | 32 ++++++++++++++++++++++++++++++ alpine/base/alpine-efi/Dockerfile | 10 ++++++++++ alpine/base/alpine-efi/Makefile | 32 ++++++++++++++++++++++++++++++ 6 files changed, 97 insertions(+), 22 deletions(-) create mode 100644 alpine/base/alpine-bios/Dockerfile create mode 100644 alpine/base/alpine-bios/Makefile create mode 100644 alpine/base/alpine-efi/Dockerfile create mode 100644 alpine/base/alpine-efi/Makefile diff --git a/alpine/Dockerfile.bios b/alpine/Dockerfile.bios index c2cf713de..b6c074f69 100644 --- a/alpine/Dockerfile.bios +++ b/alpine/Dockerfile.bios @@ -1,20 +1,16 @@ # Create a legacy BIOS bootable ISO -FROM alpine:3.4 +FROM mobylinux/alpine-bios:626757290dbb54109514af22108645cae9ea40c3 -RUN apk update && apk add \ - cdrkit \ - syslinux +WORKDIR /tmp/iso -RUN mkdir -p /tmp/iso/isolinux && \ - cp /usr/share/syslinux/isolinux.bin /tmp/iso/isolinux && \ - cp /usr/share/syslinux/ldlinux.c32 /tmp/iso/isolinux +COPY initrd.img.gz ./ +COPY kernel/x86_64/vmlinuz64 ./ +COPY isolinux.cfg ./isolinux/ -COPY initrd.img.gz /tmp/iso -COPY kernel/x86_64/vmlinuz64 /tmp/iso -COPY isolinux.cfg /tmp/iso/isolinux +RUN cp /usr/share/syslinux/isolinux.bin ./isolinux/ && \ + cp /usr/share/syslinux/ldlinux.c32 ./isolinux/ -RUN cd /tmp/iso && \ - genisoimage -o ../mobylinux-bios.iso -l -J -R \ +RUN genisoimage -o ../mobylinux-bios.iso -l -J -R \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ diff --git a/alpine/Dockerfile.efi b/alpine/Dockerfile.efi index 8768f515f..c23360a9a 100644 --- a/alpine/Dockerfile.efi +++ b/alpine/Dockerfile.efi @@ -1,15 +1,14 @@ # Create a EFI Bootable ISO -FROM alpine:3.4 +FROM mobylinux/alpine-efi:2f8c8e9ecc4bfefaf1b5ca56bac5506baba301f2 -RUN apk add --no-cache binutils mtools xorriso gummiboot +WORKDIR /tmp/efi -COPY initrd.img.gz /tmp/efi/ -COPY kernel/x86_64/vmlinuz64 /tmp/efi/ +COPY initrd.img.gz ./ +COPY kernel/x86_64/vmlinuz64 ./ # Create a EFI boot file with kernel and initrd. From: # https://github.com/haraldh/mkrescue-uefi/blob/master/mkrescue-uefi.sh -RUN cd /tmp/efi && \ - cp /usr/lib/gummiboot/linuxx64.efi.stub . && \ +RUN cp /usr/lib/gummiboot/linuxx64.efi.stub . && \ echo "earlyprintk=serial console=ttyS0 mobyplatform=windows" > cmdline.txt && \ objcopy \ --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ @@ -20,13 +19,11 @@ RUN cd /tmp/efi && \ mobylinux.efi # create a ISO with a EFI boot partition -RUN cd /tmp/efi && \ - mkdir -p iso && \ +RUN mkdir -p iso && \ dd if=/dev/zero of=iso/efi.raw bs=1024 count=70000 && \ mkfs.vfat iso/efi.raw -RUN cd /tmp/efi && \ - echo "mtools_skip_check=1" >> /etc/mtools.conf && \ +RUN echo "mtools_skip_check=1" >> /etc/mtools.conf && \ mmd -i iso/efi.raw ::/EFI && \ mmd -i iso/efi.raw ::/EFI/BOOT && \ mcopy -i iso/efi.raw mobylinux.efi ::/EFI/BOOT/BOOTX64.EFI && \ diff --git a/alpine/base/alpine-bios/Dockerfile b/alpine/base/alpine-bios/Dockerfile new file mode 100644 index 000000000..24c74721a --- /dev/null +++ b/alpine/base/alpine-bios/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.4 + +RUN \ + apk update && apk upgrade && \ + apk add \ + cdrkit \ + syslinux \ + && rm -rf /var/cache/apk/* diff --git a/alpine/base/alpine-bios/Makefile b/alpine/base/alpine-bios/Makefile new file mode 100644 index 000000000..bc229e62b --- /dev/null +++ b/alpine/base/alpine-bios/Makefile @@ -0,0 +1,32 @@ +.PHONY: tag push + +BASE=alpine:3.4 +IMAGE=alpine-bios + +default: push + +hash: + docker pull $(BASE) + tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build - + docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash + +push: hash + docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ + (docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):latest) + docker rmi $(IMAGE):build + rm -f hash + +tag: hash + docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ + (docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)) + docker rmi $(IMAGE):build + rm -f hash + +clean: + rm -f hash + +.DELETE_ON_ERROR: diff --git a/alpine/base/alpine-efi/Dockerfile b/alpine/base/alpine-efi/Dockerfile new file mode 100644 index 000000000..db73bbf25 --- /dev/null +++ b/alpine/base/alpine-efi/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.4 + +RUN \ + apk update && apk upgrade && \ + apk add \ + binutils \ + mtools \ + xorriso \ + gummiboot \ + && rm -rf /var/cache/apk/* diff --git a/alpine/base/alpine-efi/Makefile b/alpine/base/alpine-efi/Makefile new file mode 100644 index 000000000..969296238 --- /dev/null +++ b/alpine/base/alpine-efi/Makefile @@ -0,0 +1,32 @@ +.PHONY: tag push + +BASE=alpine:3.4 +IMAGE=alpine-efi + +default: push + +hash: + docker pull $(BASE) + tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build - + docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash + +push: hash + docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ + (docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):latest) + docker rmi $(IMAGE):build + rm -f hash + +tag: hash + docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ + (docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)) + docker rmi $(IMAGE):build + rm -f hash + +clean: + rm -f hash + +.DELETE_ON_ERROR: From 5d2ad6db2ba45631821ce4717d9e71d99f04761f Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 11:56:12 +0100 Subject: [PATCH 33/55] do not need to delete reproducible images Signed-off-by: Justin Cormack --- alpine/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/alpine/Makefile b/alpine/Makefile index d848c9136..4d9709d3c 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -64,8 +64,6 @@ azure: common clean: rm -f initrd.img initrd.img.gz mobylinux.vhd mobylinux.img rm -f mobylinux-bios.iso mobylinux-efi.iso mobylinux.efi - docker images -q moby-efi:build | xargs docker rmi -f || true - docker images -q moby-bios:build | xargs docker rmi -f || true docker images -q alpine_ami:latest | xargs docker rmi -f || true docker images -q alpine_azure:latest | xargs docker rmi -f || true $(MAKE) -C packages clean From c0fe2b959dd97a1d98083cd9b1013e12adc0d5b3 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 12:02:06 +0100 Subject: [PATCH 34/55] fix Makefile dependencies Signed-off-by: Justin Cormack --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bfa632937..4cb672508 100644 --- a/Makefile +++ b/Makefile @@ -10,19 +10,16 @@ alpine/kernel/x86_64/vmlinuz64: alpine/mobylinux-bios.iso: $(MAKE) -C alpine mobylinux-bios.iso -QEMU_DEPS=Dockerfile.qemu alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 -qemu: $(QEMU_DEPS) - tar cf - $(QEMU_DEPS) | docker build -f Dockerfile.qemu -t mobyqemu:build - +qemu: Dockerfile.qemu alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 + tar cf - $^ | docker build -f Dockerfile.qemu -t mobyqemu:build - docker run -it --rm mobyqemu:build -QEMU_ISO_DEPS=Dockerfile.qemuiso alpine/mobylinux-bios.iso -qemu-iso: $(TEST_DEPS) - tar cf - $(QEMU_ISO_DEPS) | docker build -f Dockerfile.qemuiso -t mobyqemuiso:build - +qemu-iso: Dockerfile.qemuiso alpine/mobylinux-bios.iso + tar cf - $^ | docker build -f Dockerfile.qemuiso -t mobyqemuiso:build - docker run -it --rm mobyqemuiso:build -TEST_DEPS=Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 -test: $(TEST_DEPS) - tar cf - $(TEST_DEPS) | docker build -f Dockerfile.test -t mobytest:build - +test: Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 + tar cf - $^ | docker build -f Dockerfile.test -t mobytest:build - touch test.log docker run --rm mobytest:build 2>&1 | tee -a test.log & tail -f test.log 2>/dev/null | grep -m 1 -q 'Moby test suite ' From cb9178f314330493c982d707115cbc1f022df9b7 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 12:12:41 +0100 Subject: [PATCH 35/55] Use our own qemu base image Signed-off-by: Justin Cormack --- Dockerfile.qemu | 2 +- Dockerfile.qemu.armhf | 9 --------- Dockerfile.qemuiso | 2 +- Dockerfile.test | 2 +- alpine/base/alpine-qemu/Dockerfile | 9 +++++++++ alpine/base/alpine-qemu/Makefile | 32 ++++++++++++++++++++++++++++++ 6 files changed, 44 insertions(+), 12 deletions(-) delete mode 100644 Dockerfile.qemu.armhf create mode 100644 alpine/base/alpine-qemu/Dockerfile create mode 100644 alpine/base/alpine-qemu/Makefile diff --git a/Dockerfile.qemu b/Dockerfile.qemu index 20fca7c0e..e55b4ec0d 100644 --- a/Dockerfile.qemu +++ b/Dockerfile.qemu @@ -1,4 +1,4 @@ -FROM justincormack/alpine-qemu +FROM mobylinux/alpine-qemu:1f3de121e9dea39a198413344a72049839bea91b COPY alpine/initrd.img.gz . COPY alpine/kernel/x86_64/vmlinuz64 . diff --git a/Dockerfile.qemu.armhf b/Dockerfile.qemu.armhf deleted file mode 100644 index 25ef995e1..000000000 --- a/Dockerfile.qemu.armhf +++ /dev/null @@ -1,9 +0,0 @@ -FROM justincormack/alpine-qemu - -COPY alpine/initrd-arm.img . -COPY alpine/kernel/arm/zImage . -COPY alpine/kernel/dtb dtb - -RUN gzip -9 initrd-arm.img - -ENTRYPOINT [ "qemu-system-arm", "-machine", "vexpress-a15", "-cpu", "cortex-a15", "-no-reboot", "-netdev", "user,id=eth0", "-device", "virtio-net-device,netdev=eth0", "-serial", "stdio", "-kernel", "zImage", "-initrd", "initrd-arm.img.gz", "-dtb", "dtb/vexpress-v2p-ca15-tc1.dtb", "-m", "1024", "-append", "console=ttyAMA0,38400n8", "-vnc", "none" ] diff --git a/Dockerfile.qemuiso b/Dockerfile.qemuiso index 8ff221216..042612597 100644 --- a/Dockerfile.qemuiso +++ b/Dockerfile.qemuiso @@ -1,4 +1,4 @@ -FROM justincormack/alpine-qemu +FROM mobylinux/alpine-qemu:1f3de121e9dea39a198413344a72049839bea91b COPY alpine/mobylinux-bios.iso . diff --git a/Dockerfile.test b/Dockerfile.test index 62d7effe6..a139de963 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM justincormack/alpine-qemu +FROM mobylinux/alpine-qemu:1f3de121e9dea39a198413344a72049839bea91b COPY alpine/initrd.img.gz . COPY alpine/kernel/x86_64/vmlinuz64 . diff --git a/alpine/base/alpine-qemu/Dockerfile b/alpine/base/alpine-qemu/Dockerfile new file mode 100644 index 000000000..3c15db068 --- /dev/null +++ b/alpine/base/alpine-qemu/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine:3.4 + +RUN \ + apk update && apk upgrade && \ + apk add \ + qemu-img \ + qemu-system-arm \ + qemu-system-x86_64 \ + && rm -rf /var/cache/apk/* diff --git a/alpine/base/alpine-qemu/Makefile b/alpine/base/alpine-qemu/Makefile new file mode 100644 index 000000000..fd9a07309 --- /dev/null +++ b/alpine/base/alpine-qemu/Makefile @@ -0,0 +1,32 @@ +.PHONY: tag push + +BASE=alpine:3.4 +IMAGE=alpine-qemu + +default: push + +hash: + docker pull $(BASE) + tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build - + docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash + +push: hash + docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ + (docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):latest) + docker rmi $(IMAGE):build + rm -f hash + +tag: hash + docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ + (docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)) + docker rmi $(IMAGE):build + rm -f hash + +clean: + rm -f hash + +.DELETE_ON_ERROR: From a99eec5151bb8c1f8c02d0fd677ad473eb254520 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 12:51:37 +0100 Subject: [PATCH 36/55] Set CMD to mkinitrd Signed-off-by: Justin Cormack --- alpine/Dockerfile | 2 +- alpine/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 79a38fa98..66bafcfda 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -51,4 +51,4 @@ RUN \ rc-update add azure default && \ true -CMD ["/bin/sh"] +CMD ["/mkinitrd.sh"] diff --git a/alpine/Makefile b/alpine/Makefile index 4d9709d3c..8881561ab 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -31,7 +31,7 @@ initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) common -C packages/azure etc -C ../.. \ | \ docker build -t moby-initrd:build - - docker run --net=none --rm moby-initrd:build /mkinitrd.sh > $@ + docker run --net=none --rm moby-initrd:build > $@ initrd.img.gz: initrd.img cat initrd.img | gzip -9 > initrd.img.gz From 98fee5bd32a1ea71e66ff28da2affd9002b4f122 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 13:19:21 +0100 Subject: [PATCH 37/55] no longer need dockerignore Signed-off-by: Justin Cormack --- .dockerignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index b1a133833..000000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -xhyve/ -alpine/packages From 5c79c1caf84d090d81649de710a48de2cdaf3404 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 14:51:48 +0100 Subject: [PATCH 38/55] for now, make sure rebuild on make test Signed-off-by: Justin Cormack --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 4cb672508..6034bd4d5 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ qemu-iso: Dockerfile.qemuiso alpine/mobylinux-bios.iso docker run -it --rm mobyqemuiso:build test: Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 + $(MAKE) -C alpine tar cf - $^ | docker build -f Dockerfile.test -t mobytest:build - touch test.log docker run --rm mobytest:build 2>&1 | tee -a test.log & From 7d08c3f9c14fb8b0eb833eb00e369d361b1c117f Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 15:06:05 +0100 Subject: [PATCH 39/55] we never use uncompressed initrd, so always compress Signed-off-by: Justin Cormack --- Dockerfile.qemu | 4 ++-- Dockerfile.test | 4 ++-- Makefile | 8 ++++---- alpine/Dockerfile.bios | 2 +- alpine/Dockerfile.efi | 4 ++-- alpine/Makefile | 12 ++++-------- alpine/isolinux.cfg | 2 +- alpine/mkinitrd.sh | 2 +- 8 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Dockerfile.qemu b/Dockerfile.qemu index e55b4ec0d..2f6753140 100644 --- a/Dockerfile.qemu +++ b/Dockerfile.qemu @@ -1,8 +1,8 @@ FROM mobylinux/alpine-qemu:1f3de121e9dea39a198413344a72049839bea91b -COPY alpine/initrd.img.gz . +COPY alpine/initrd.img . COPY alpine/kernel/x86_64/vmlinuz64 . RUN qemu-img create -f raw disk.img 100M -ENTRYPOINT [ "qemu-system-x86_64", "-drive", "file=disk.img,format=raw", "-device", "virtio-rng-pci", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "2048", "-append", "earlyprintk=serial console=ttyS0 noapic", "-vnc", "none" ] +ENTRYPOINT [ "qemu-system-x86_64", "-drive", "file=disk.img,format=raw", "-device", "virtio-rng-pci", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img", "-m", "2048", "-append", "earlyprintk=serial console=ttyS0 noapic", "-vnc", "none" ] diff --git a/Dockerfile.test b/Dockerfile.test index a139de963..a3e325cf8 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,8 +1,8 @@ FROM mobylinux/alpine-qemu:1f3de121e9dea39a198413344a72049839bea91b -COPY alpine/initrd.img.gz . +COPY alpine/initrd.img . COPY alpine/kernel/x86_64/vmlinuz64 . RUN qemu-img create -f raw disk.img 100M -ENTRYPOINT [ "qemu-system-x86_64", "-drive", "file=disk.img,format=raw", "-device", "virtio-rng-pci", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "1024", "-append", "earlyprintk=serial console=ttyS0 noapic mobyplatform=test", "-vnc", "none" ] +ENTRYPOINT [ "qemu-system-x86_64", "-drive", "file=disk.img,format=raw", "-device", "virtio-rng-pci", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img", "-m", "1024", "-append", "earlyprintk=serial console=ttyS0 noapic mobyplatform=test", "-vnc", "none" ] diff --git a/Makefile b/Makefile index 6034bd4d5..9e52ffddf 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ all: $(MAKE) -C alpine -alpine/initrd.img.gz: - $(MAKE) -C alpine initrd.img.gz +alpine/initrd.img: + $(MAKE) -C alpine initrd.img alpine/kernel/x86_64/vmlinuz64: $(MAKE) -C alpine/kernel x86_64/vmlinuz64 @@ -10,7 +10,7 @@ alpine/kernel/x86_64/vmlinuz64: alpine/mobylinux-bios.iso: $(MAKE) -C alpine mobylinux-bios.iso -qemu: Dockerfile.qemu alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 +qemu: Dockerfile.qemu alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 tar cf - $^ | docker build -f Dockerfile.qemu -t mobyqemu:build - docker run -it --rm mobyqemu:build @@ -18,7 +18,7 @@ qemu-iso: Dockerfile.qemuiso alpine/mobylinux-bios.iso tar cf - $^ | docker build -f Dockerfile.qemuiso -t mobyqemuiso:build - docker run -it --rm mobyqemuiso:build -test: Dockerfile.test alpine/initrd.img.gz alpine/kernel/x86_64/vmlinuz64 +test: Dockerfile.test alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 $(MAKE) -C alpine tar cf - $^ | docker build -f Dockerfile.test -t mobytest:build - touch test.log diff --git a/alpine/Dockerfile.bios b/alpine/Dockerfile.bios index b6c074f69..7a78d7361 100644 --- a/alpine/Dockerfile.bios +++ b/alpine/Dockerfile.bios @@ -3,7 +3,7 @@ FROM mobylinux/alpine-bios:626757290dbb54109514af22108645cae9ea40c3 WORKDIR /tmp/iso -COPY initrd.img.gz ./ +COPY initrd.img ./ COPY kernel/x86_64/vmlinuz64 ./ COPY isolinux.cfg ./isolinux/ diff --git a/alpine/Dockerfile.efi b/alpine/Dockerfile.efi index c23360a9a..92d7ba8e5 100644 --- a/alpine/Dockerfile.efi +++ b/alpine/Dockerfile.efi @@ -3,7 +3,7 @@ FROM mobylinux/alpine-efi:2f8c8e9ecc4bfefaf1b5ca56bac5506baba301f2 WORKDIR /tmp/efi -COPY initrd.img.gz ./ +COPY initrd.img ./ COPY kernel/x86_64/vmlinuz64 ./ # Create a EFI boot file with kernel and initrd. From: @@ -14,7 +14,7 @@ RUN cp /usr/lib/gummiboot/linuxx64.efi.stub . && \ --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ --add-section .cmdline=./cmdline.txt --change-section-vma .cmdline=0x30000 \ --add-section .linux=./vmlinuz64 --change-section-vma .linux=0x40000 \ - --add-section .initrd=initrd.img.gz --change-section-vma .initrd=0x3000000 \ + --add-section .initrd=initrd.img --change-section-vma .initrd=0x3000000 \ ./linuxx64.efi.stub \ mobylinux.efi diff --git a/alpine/Makefile b/alpine/Makefile index 8881561ab..5873cd5b7 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -1,4 +1,4 @@ -all: initrd.img.gz mobylinux-efi.iso +all: initrd.img mobylinux-efi.iso ETCFILES=etc/issue etc/motd etc/network/interfaces ETCFILES+=etc/inittab etc/fstab @@ -33,15 +33,12 @@ initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) common docker build -t moby-initrd:build - docker run --net=none --rm moby-initrd:build > $@ -initrd.img.gz: initrd.img - cat initrd.img | gzip -9 > initrd.img.gz - -mobylinux-efi.iso: Dockerfile.efi initrd.img.gz kernel/x86_64/vmlinuz64 +mobylinux-efi.iso: Dockerfile.efi initrd.img kernel/x86_64/vmlinuz64 tar cf - $^ | docker build -t moby-efi:build -f Dockerfile.efi - docker run --net=none --rm --cap-add sys_admin moby-efi:build cat /tmp/efi/mobylinux.efi > mobylinux.efi docker run --net=none --rm --cap-add sys_admin moby-efi:build cat /tmp/efi/mobylinux-efi.iso > $@ -mobylinux-bios.iso: Dockerfile.bios initrd.img.gz kernel/x86_64/vmlinuz64 isolinux.cfg +mobylinux-bios.iso: Dockerfile.bios initrd.img kernel/x86_64/vmlinuz64 isolinux.cfg tar cf - $^ | docker build -t moby-bios:build -f Dockerfile.bios - docker run --net=none --rm moby-bios:build cat /tmp/mobylinux-bios.iso > $@ @@ -62,8 +59,7 @@ azure: common docker-compose run --rm -T azure uploadvhd clean: - rm -f initrd.img initrd.img.gz mobylinux.vhd mobylinux.img - rm -f mobylinux-bios.iso mobylinux-efi.iso mobylinux.efi + rm -f initrd.img mobylinux.vhd mobylinux.img mobylinux-bios.iso mobylinux-efi.iso mobylinux.efi docker images -q alpine_ami:latest | xargs docker rmi -f || true docker images -q alpine_azure:latest | xargs docker rmi -f || true $(MAKE) -C packages clean diff --git a/alpine/isolinux.cfg b/alpine/isolinux.cfg index 9c700b21a..660d27c6c 100644 --- a/alpine/isolinux.cfg +++ b/alpine/isolinux.cfg @@ -1,5 +1,5 @@ DEFAULT linux LABEL linux KERNEL /vmlinuz64 - INITRD /initrd.img.gz + INITRD /initrd.img APPEND earlyprintk=serial console=ttyS0 console=tty1 diff --git a/alpine/mkinitrd.sh b/alpine/mkinitrd.sh index 894b080de..0bf4a43fd 100755 --- a/alpine/mkinitrd.sh +++ b/alpine/mkinitrd.sh @@ -35,4 +35,4 @@ printf 'moby' > /tmp/etc/hostname rm /tmp/mkinitrd.sh cd /tmp -find . | cpio -H newc -o +find . | cpio -H newc -o | gzip -9 From cd6507f1d0d27d77def3bb29dd13986fb3b01491 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 15:56:34 +0100 Subject: [PATCH 40/55] for release docker binaries we can fetch from docker hub rather than curl, so will be cached Allow override in case docker images not released Signed-off-by: Justin Cormack --- alpine/packages/docker/Makefile | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/alpine/packages/docker/Makefile b/alpine/packages/docker/Makefile index fe2ec2903..ebcd22c5f 100644 --- a/alpine/packages/docker/Makefile +++ b/alpine/packages/docker/Makefile @@ -3,15 +3,37 @@ ARCH?=x86_64 OS?=Linux DOCKER_EXPERIMENTAL?=1 +DOCKER_BINARIES?=docker dockerd docker-proxy docker-runc docker-containerd docker-containerd-ctr docker-containerd-shim + all: usr/bin/docker TEST_HOST=$(shell if echo "$(DOCKER_VERSION)" | grep -q -- '-rc'; then echo "test.docker.com"; else echo "get.docker.com"; fi) -DOCKER_HOST?=$(shell [ "${DOCKER_EXPERIMENTAL}" -eq 1 ] && printf "experimental.docker.com" || printf "${TEST_HOST}") -DOCKER_BIN_URL?="https://${DOCKER_HOST}/builds/${OS}/${ARCH}/docker-${DOCKER_VERSION}.tgz" +ifeq ($(DOCKER_EXPERIMENTAL),1) +DOCKER_HOST=experimental.docker.com +DOCKER_IMAGE?=docker:$(DOCKER_VERSION)-experimental +else +DOCKER_HOST=$(TEST_HOST) +DOCKER_IMAGE?=docker:$(DOCKER_VERSION) +endif -usr/bin/docker: +.PHONY: download hub cleanusr + +ifeq ($(DOCKER_BIN_URL)$(FORCE_CURL),) +usr/bin/docker: hub +else +usr/bin/docker: download +endif + +cleanusr: mkdir -p usr/bin - curl -sSL ${DOCKER_BIN_URL} | tar xzf - && \ + rm -f usr/bin/* + +download: cleanusr +ifdef DOCKER_BIN_URL + curl -sSL ${DOCKER_BIN_URL} | tar xzf - +else + curl -sSL https://${DOCKER_HOST}/builds/${OS}/${ARCH}/docker-${DOCKER_VERSION}.tgz | tar xzf - +endif mv docker/docker-containerd-ctr \ docker/docker \ docker/docker-containerd \ @@ -21,6 +43,9 @@ usr/bin/docker: docker/docker-containerd-shim \ usr/bin/ +hub: cleanusr + docker run $(DOCKER_IMAGE) tar cf - -C /usr/local/bin $(DOCKER_BINARIES) | tar xf - -C usr/bin + clean: rm -rf usr/ docker/ From 6fdcb8716ac8030451890b2daf9bd9d35d7f5a49 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 19:45:08 +0100 Subject: [PATCH 41/55] Add a media target to push final artefacts to tagged by commit id Signed-off-by: Justin Cormack --- Dockerfile.media | 3 +++ Makefile | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Dockerfile.media diff --git a/Dockerfile.media b/Dockerfile.media new file mode 100644 index 000000000..c031db6f5 --- /dev/null +++ b/Dockerfile.media @@ -0,0 +1,3 @@ +FROM scratch + +ADD alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 alpine/mobylinux-bios.iso alpine/mobylinux-efi.iso / diff --git a/Makefile b/Makefile index 9e52ffddf..b4954d7fb 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,18 @@ test: Dockerfile.test alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 tail -f test.log 2>/dev/null | grep -m 1 -q 'Moby test suite ' cat test.log | grep -q 'Moby test suite PASSED' +TAG=$(shell git rev-parse HEAD) +STATUS=$(shell git status -s) +media: Dockerfile.media alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 alpine/mobylinux-bios.iso alpine/mobylinux-efi.iso +ifeq ($(STATUS),) + tar cf - $^ | docker build -f Dockerfile.media -t mobylinux/media:latest - + docker tag mobylinux/media:latest mobylinux/media:$(TAG) + docker push mobylinux/media:$(TAG) + docker push mobylinux/media:latest +else + $(error "git not clean") +endif + .PHONY: clean clean: From 85158fec4df2f1c06c96c3f3a655216bba4b9ee5 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 20:51:02 +0100 Subject: [PATCH 42/55] make bios iso by default Signed-off-by: Justin Cormack --- alpine/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine/Makefile b/alpine/Makefile index 5873cd5b7..599d47836 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -1,4 +1,4 @@ -all: initrd.img mobylinux-efi.iso +all: initrd.img mobylinux-efi.iso mobylinux-bios.iso ETCFILES=etc/issue etc/motd etc/network/interfaces ETCFILES+=etc/inittab etc/fstab From 4ac419e66328ce43db5da8d7d768df8d30d3bba1 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 20:53:51 +0100 Subject: [PATCH 43/55] Add mobylinux.efi to media Signed-off-by: Justin Cormack --- Dockerfile.media | 8 +++++++- Makefile | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile.media b/Dockerfile.media index c031db6f5..fa1de01b0 100644 --- a/Dockerfile.media +++ b/Dockerfile.media @@ -1,3 +1,9 @@ FROM scratch -ADD alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 alpine/mobylinux-bios.iso alpine/mobylinux-efi.iso / +ADD \ + alpine/initrd.img \ + alpine/kernel/x86_64/vmlinuz64 \ + alpine/mobylinux-bios.iso \ + alpine/mobylinux-efi.iso \ + alpine/mobylinux.efi \ + / diff --git a/Makefile b/Makefile index b4954d7fb..4c2ba598f 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ TAG=$(shell git rev-parse HEAD) STATUS=$(shell git status -s) media: Dockerfile.media alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 alpine/mobylinux-bios.iso alpine/mobylinux-efi.iso ifeq ($(STATUS),) - tar cf - $^ | docker build -f Dockerfile.media -t mobylinux/media:latest - + tar cf - $^ alpine/mobylinux.efi | docker build -f Dockerfile.media -t mobylinux/media:latest - docker tag mobylinux/media:latest mobylinux/media:$(TAG) docker push mobylinux/media:$(TAG) docker push mobylinux/media:latest From 91fbb9c245be709c1d0ad02f6de3b7c99d5a091a Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 23:45:08 +0100 Subject: [PATCH 44/55] revert to debian for kernel build Signed-off-by: Justin Cormack --- alpine/kernel/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine/kernel/Dockerfile b/alpine/kernel/Dockerfile index fa4e5657c..e3e42aea1 100644 --- a/alpine/kernel/Dockerfile +++ b/alpine/kernel/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM debian:jessie ARG KERNEL_VERSION=4.4.20 ARG DEBUG=0 From 206dfe0950014154da7c8d9e17f54afb1bce3879 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Sun, 11 Sep 2016 23:49:36 +0100 Subject: [PATCH 45/55] simplify vendor tar Signed-off-by: Justin Cormack --- alpine/packages/diagnostics/Makefile | 2 +- alpine/packages/proxy/Makefile | 2 +- alpine/packages/vsudd/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine/packages/diagnostics/Makefile b/alpine/packages/diagnostics/Makefile index 6be88f03e..b296d5485 100644 --- a/alpine/packages/diagnostics/Makefile +++ b/alpine/packages/diagnostics/Makefile @@ -3,7 +3,7 @@ all: usr/bin/diagnostics-server DEPS=Dockerfile $(wildcard *.go) usr/bin/diagnostics-server: $(DEPS) ../vendor/manifest - tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t diagnostics-server:build - + tar cf - $(DEPS) -C .. vendor | docker build -t diagnostics-server:build - docker run --rm --net=none diagnostics-server:build | tar xf - -C usr/bin clean: diff --git a/alpine/packages/proxy/Makefile b/alpine/packages/proxy/Makefile index d4a54051d..a0d58c19d 100644 --- a/alpine/packages/proxy/Makefile +++ b/alpine/packages/proxy/Makefile @@ -3,7 +3,7 @@ all: usr/bin/slirp-proxy sbin/proxy-vsockd DEPS=Dockerfile $(wildcard *.go libproxy/*.go) proxy: $(DEPS) ../vendor/manifest - tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t proxy:build - + tar cf - $(DEPS) -C .. vendor | docker build -t proxy:build - docker run --rm --net=none proxy:build | tar xf - usr/bin/slirp-proxy: proxy diff --git a/alpine/packages/vsudd/Makefile b/alpine/packages/vsudd/Makefile index 93c3dec0a..6189b7fb5 100644 --- a/alpine/packages/vsudd/Makefile +++ b/alpine/packages/vsudd/Makefile @@ -4,7 +4,7 @@ DEPS=Dockerfile $(wildcard *.go) vsudd: $(DEPS) ../vendor/manifest mkdir -p sbin - tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t vsudd:build - + tar cf - $(DEPS) -C .. vendor | docker build -t vsudd:build - docker run --rm --net=none vsudd:build | tar xf - -C sbin clean: From 459809929ce2a2824d988bdeb22170658593fed9 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 00:01:39 +0100 Subject: [PATCH 46/55] update README with build reqs Signed-off-by: Justin Cormack --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6f6688cb2..1e2e69418 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ -Base repo for Moby, codename for the Docker Linux distro - -Initial requirements are being driven by the very minimal goal of replacing boot2docker for the new Mac app. - -However these requirements are fairly small and the scope is intended to be much broader. +Moby, the Alpine Linux distro for Docker editions Simple build instructions: use `make` to build. `make qemu` will boot up in qemu in a container. -You can build for arm, some parts still under development, `make clean` first, then `make qemu-arm` will run in qemu. +Requires GNU `make`, GNU `tar` (not Busybox tar), Docker to build. From 8ed08dcddae1d346f7417e42ae406d785f90067f Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 00:11:57 +0100 Subject: [PATCH 47/55] Make self hosting by adding make and GNU tar Signed-off-by: Justin Cormack --- alpine/Dockerfile | 2 +- alpine/base/alpine-base/Dockerfile | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 66bafcfda..f17366632 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/alpine-base:32042e9cf243f06f9ecb10bfd64e3dd059b9650d +FROM mobylinux/alpine-base:5ee3744f0fbcdd3e9c6216322e1d023e4cdf9ee4 ENV ARCH=x86_64 diff --git a/alpine/base/alpine-base/Dockerfile b/alpine/base/alpine-base/Dockerfile index bfeaed050..ba0a16479 100644 --- a/alpine/base/alpine-base/Dockerfile +++ b/alpine/base/alpine-base/Dockerfile @@ -3,24 +3,26 @@ FROM alpine:3.4 RUN \ apk update && apk upgrade && \ apk add \ - e2fsprogs \ - chrony \ - git \ - xz \ - iptables \ - sfdisk \ - lvm2 \ - syslinux \ - openrc \ - busybox-initscripts \ alpine-conf \ bind-tools \ - openssh-client \ - strace \ - fuse \ + busybox-initscripts \ + chrony \ cifs-utils \ + e2fsprogs \ e2fsprogs-extra \ - openssl \ + fuse \ + git \ + iptables \ jq \ + lvm2 \ + make \ + openrc \ + openssh-client \ + openssl \ + sfdisk \ + strace \ sysklogd \ + syslinux \ + tar \ + xz \ && rm -rf /var/cache/apk/* From 35070c03f79762b4b7d90c60274a7ee122730734 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 00:41:04 +0100 Subject: [PATCH 48/55] Use a base image for building kernel As we do not have a simple way to hash Debian, use the Docker sha256 until we switch to Alpine. Signed-off-by: Justin Cormack --- alpine/base/debian-build-kernel/Dockerfile | 24 ++++++++++++++++ alpine/base/debian-build-kernel/Makefile | 10 +++++++ alpine/kernel/Dockerfile | 33 ++++------------------ 3 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 alpine/base/debian-build-kernel/Dockerfile create mode 100644 alpine/base/debian-build-kernel/Makefile diff --git a/alpine/base/debian-build-kernel/Dockerfile b/alpine/base/debian-build-kernel/Dockerfile new file mode 100644 index 000000000..3ea659a18 --- /dev/null +++ b/alpine/base/debian-build-kernel/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:jessie + +RUN apt-get update && apt-get -y upgrade && apt-get -y install \ + unzip \ + xz-utils \ + curl \ + bc \ + build-essential \ + cpio \ + gcc libc6 libc6-dev \ + kmod \ + squashfs-tools \ + genisoimage \ + xorriso \ + syslinux \ + isolinux \ + automake \ + pkg-config \ + git \ + ncurses-dev \ + p7zip-full \ + lzop \ + wget \ + vim diff --git a/alpine/base/debian-build-kernel/Makefile b/alpine/base/debian-build-kernel/Makefile new file mode 100644 index 000000000..2cfcae3a1 --- /dev/null +++ b/alpine/base/debian-build-kernel/Makefile @@ -0,0 +1,10 @@ +# no easy hashing scheme for Debian, will switch to Alpine soon so temporarily use sha256 +.PHONY: push + +BASE=debian:jessie +IMAGE=debian-build-kernel + +push: + docker pull $(BASE) + tar cf - Dockerfile | docker build --no-cache -t mobylinux/$(IMAGE):latest - + docker push mobylinux/$(IMAGE):latest diff --git a/alpine/kernel/Dockerfile b/alpine/kernel/Dockerfile index e3e42aea1..1f57e13c4 100644 --- a/alpine/kernel/Dockerfile +++ b/alpine/kernel/Dockerfile @@ -1,33 +1,10 @@ -FROM debian:jessie +FROM mobylinux/debian-build-kernel@sha256:412d36481df6123efc9a5a51656e13164f8178d11d682c63de8de82d43abd0d2 ARG KERNEL_VERSION=4.4.20 ARG DEBUG=0 ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz -RUN apt-get update && apt-get -y upgrade && apt-get -y install \ - unzip \ - xz-utils \ - curl \ - bc \ - build-essential \ - cpio \ - gcc libc6 libc6-dev \ - kmod \ - squashfs-tools \ - genisoimage \ - xorriso \ - syslinux \ - isolinux \ - automake \ - pkg-config \ - git \ - ncurses-dev \ - p7zip-full \ - lzop \ - wget \ - vim - RUN curl -sSL -o linux-${KERNEL_VERSION}.tar.xz ${KERNEL_SOURCE} RUN cat linux-${KERNEL_VERSION}.tar.xz | tar --absolute-names -xJ && mv /linux-${KERNEL_VERSION} /linux @@ -37,11 +14,13 @@ ENV AUFS_REPO https://github.com/sfjro/aufs4-standalone ENV AUFS_BRANCH aufs4.4 ENV AUFS_COMMIT 8be74e42b108f9cbbb0d59a87468505a48ff2757 -# Download AUFS and patch kernel +# Download AUFS RUN git clone -b "$AUFS_BRANCH" "$AUFS_REPO" /aufs && \ cd /aufs && \ - git checkout -q "$AUFS_COMMIT" && \ - cd /linux && \ + git checkout -q "$AUFS_COMMIT" + +# patch kernel with aufs +RUN cd /linux && \ cp -r /aufs/Documentation /linux && \ cp -r /aufs/fs /linux && \ cp -r /aufs/include/uapi/linux/aufs_type.h /linux/include/uapi/linux/ && \ From 145dead1100e698448d2d5e620e998e7f3f62b31 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 10:12:48 +0100 Subject: [PATCH 49/55] do not need to remove images in make clean Signed-off-by: Justin Cormack --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 4c2ba598f..d3285ebfb 100644 --- a/Makefile +++ b/Makefile @@ -42,5 +42,3 @@ endif clean: $(MAKE) -C alpine clean - docker images -q mobyqemu:build | xargs docker rmi -f || true - docker images -q mobytest:build | xargs docker rmi -f || true From 955aad6276b7982416458cdac7ccc329762c798d Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 12:06:24 +0100 Subject: [PATCH 50/55] Use a random tag for Debian kernel build base To store all the old images they need a different tag, so use a random one. Signed-off-by: Justin Cormack --- alpine/base/debian-build-kernel/Makefile | 6 +++++- alpine/kernel/Dockerfile | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/alpine/base/debian-build-kernel/Makefile b/alpine/base/debian-build-kernel/Makefile index 2cfcae3a1..60428abf0 100644 --- a/alpine/base/debian-build-kernel/Makefile +++ b/alpine/base/debian-build-kernel/Makefile @@ -4,7 +4,11 @@ BASE=debian:jessie IMAGE=debian-build-kernel +TAG := $(shell cat /dev/urandom | od -N6 -t x2 | head -n1 | cut -b9- | sed 's/ //g') + push: docker pull $(BASE) - tar cf - Dockerfile | docker build --no-cache -t mobylinux/$(IMAGE):latest - + tar cf - Dockerfile | docker build --no-cache -t mobylinux/$(IMAGE):$(TAG) - + docker tag mobylinux/$(IMAGE):$(TAG) mobylinux/$(IMAGE):latest + docker push mobylinux/$(IMAGE):$(TAG) docker push mobylinux/$(IMAGE):latest diff --git a/alpine/kernel/Dockerfile b/alpine/kernel/Dockerfile index 1f57e13c4..5b0ba0064 100644 --- a/alpine/kernel/Dockerfile +++ b/alpine/kernel/Dockerfile @@ -1,4 +1,4 @@ -FROM mobylinux/debian-build-kernel@sha256:412d36481df6123efc9a5a51656e13164f8178d11d682c63de8de82d43abd0d2 +FROM mobylinux/debian-build-kernel:a009a11bf0ad ARG KERNEL_VERSION=4.4.20 ARG DEBUG=0 From 9b2e1367f977a49b8ca6ddf90a6018a40a142e44 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 12:37:09 +0100 Subject: [PATCH 51/55] add experimental- prefix for experimental Docker versions in media Signed-off-by: Justin Cormack --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d3285ebfb..deeaa1009 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +DOCKER_EXPERIMENTAL?=1 + all: $(MAKE) -C alpine @@ -28,12 +30,15 @@ test: Dockerfile.test alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 TAG=$(shell git rev-parse HEAD) STATUS=$(shell git status -s) +ifeq ($(DOCKER_EXPERIMENTAL),1) +EXP_PREFIX=experimental- +endif media: Dockerfile.media alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 alpine/mobylinux-bios.iso alpine/mobylinux-efi.iso ifeq ($(STATUS),) - tar cf - $^ alpine/mobylinux.efi | docker build -f Dockerfile.media -t mobylinux/media:latest - - docker tag mobylinux/media:latest mobylinux/media:$(TAG) - docker push mobylinux/media:$(TAG) - docker push mobylinux/media:latest + tar cf - $^ alpine/mobylinux.efi | docker build -f Dockerfile.media -t mobylinux/media:$(EXP_PREFIX)latest - + docker tag mobylinux/media:$(EXP_PREFIX)latest mobylinux/media:$(EXP_PREFIX)$(TAG) + docker push mobylinux/media:$(EXP_PREFIX)$(TAG) + docker push mobylinux/media:$(EXP_PREFIX)latest else $(error "git not clean") endif From 9c88f7826264e61c6cbac2fb37c8d1fca103be35 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 12:47:05 +0100 Subject: [PATCH 52/55] gitignore vi swp files Signed-off-by: Justin Cormack --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c7ec943dd..d4b066b0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ test.log +*.swp From 5e4e7d1c7ff61f37c6a21d55a96a04e257a320a6 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 12:47:42 +0100 Subject: [PATCH 53/55] rm docker container used for binary extraction Signed-off-by: Justin Cormack --- alpine/packages/docker/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine/packages/docker/Makefile b/alpine/packages/docker/Makefile index ebcd22c5f..ea4c2ccfa 100644 --- a/alpine/packages/docker/Makefile +++ b/alpine/packages/docker/Makefile @@ -44,7 +44,7 @@ endif usr/bin/ hub: cleanusr - docker run $(DOCKER_IMAGE) tar cf - -C /usr/local/bin $(DOCKER_BINARIES) | tar xf - -C usr/bin + docker run --rm $(DOCKER_IMAGE) tar cf - -C /usr/local/bin $(DOCKER_BINARIES) | tar xf - -C usr/bin clean: rm -rf usr/ docker/ From a12411b7940275a24b92b3f7f19c70b466bb3ffb Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 13:25:12 +0100 Subject: [PATCH 54/55] allow overriding the media prefix, so can make custom modifications eg for custom Docker versions Signed-off-by: Justin Cormack --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index deeaa1009..af677c038 100644 --- a/Makefile +++ b/Makefile @@ -31,14 +31,14 @@ test: Dockerfile.test alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 TAG=$(shell git rev-parse HEAD) STATUS=$(shell git status -s) ifeq ($(DOCKER_EXPERIMENTAL),1) -EXP_PREFIX=experimental- +MEDIA_PREFIX?=experimental- endif media: Dockerfile.media alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 alpine/mobylinux-bios.iso alpine/mobylinux-efi.iso ifeq ($(STATUS),) - tar cf - $^ alpine/mobylinux.efi | docker build -f Dockerfile.media -t mobylinux/media:$(EXP_PREFIX)latest - - docker tag mobylinux/media:$(EXP_PREFIX)latest mobylinux/media:$(EXP_PREFIX)$(TAG) - docker push mobylinux/media:$(EXP_PREFIX)$(TAG) - docker push mobylinux/media:$(EXP_PREFIX)latest + tar cf - $^ alpine/mobylinux.efi | docker build -f Dockerfile.media -t mobylinux/media:$(MEDIA_PREFIX)latest - + docker tag mobylinux/media:$(EXP_PREFIX)latest mobylinux/media:$(MEDIA_PREFIX)$(TAG) + docker push mobylinux/media:$(MEDIA_PREFIX)$(TAG) + docker push mobylinux/media:$(MEDIA_PREFIX)latest else $(error "git not clean") endif From 1525dacf3266362974cd3798bb51ddfe48925514 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 20:35:04 +0100 Subject: [PATCH 55/55] document the Docker Hub repos Signed-off-by: Justin Cormack --- docs/hub.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/hub.md diff --git a/docs/hub.md b/docs/hub.md new file mode 100644 index 000000000..7d39c5bf2 --- /dev/null +++ b/docs/hub.md @@ -0,0 +1,21 @@ +## Docker Hub + +There are images on Docker Hub to help with reproducible builds. These are built (by hand) from `alpine/base`, +generally with tags based on the image contents. + +- `mobylinux/alpine-base` the base packages for Moby, before we add Docker and our code and config +- `mobylinux/alpine-build-c` for building C code +- `mobylinux/alpine-build-go` for building Go code +- `mobylinux/alpine-bios` for building BIOS image +- `mobylinux/alpine-efi` for building efi images +- `mobylinux/alpine-qemu` for Qemu eg for the tests +- `mobylinux/debian-build-kernel` for the kernel builds while we cannot use Alpine + +In addition +- `mobylinux/media` contains build artifacts + +You can upload build artifacts with `make media` or `make media MEDIA_PREFIX=1.12.0-` if you want to change the prefix of the git hash. +The will by default be prefixed by `experimental-` if they are Docker experimental builds. These are used in the Mac and Windows build +process to get the images. + +Ping @justincormack if you need access to the Hub organization.