1248 Commits
v0.4 ... v0.7

Author SHA1 Message Date
Rolf Neugebauer
4f4f7feae1 Merge pull request #3329 from rn/rel_v0.7
Release v0.7
2019-04-17 21:38:31 +01:00
Rolf Neugebauer
ea9a9dd763 Update CHANGELOG
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-17 09:48:29 +01:00
Rolf Neugebauer
ac81de2ac3 Update version in top-level Makefile
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-17 09:48:29 +01:00
Rolf Neugebauer
087badc8b7 Update AUTHORS
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-17 09:48:29 +01:00
Rolf Neugebauer
51fd2916c6 kernel: Update gcc version in kernel config files
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-17 08:28:21 +01:00
Rolf Neugebauer
03e0d67051 kernel: Update alpine to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-17 07:43:18 +01:00
Rolf Neugebauer
291a95d3fa Update package tags to v0.7
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 23:46:27 +01:00
Rolf Neugebauer
c7799a9080 pkgs: Update packages to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 23:25:22 +01:00
Rolf Neugebauer
ba9a266b6a tests: Update tests cases to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 23:23:41 +01:00
Rolf Neugebauer
344cba78e5 Update use of test packages to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 23:23:27 +01:00
Rolf Neugebauer
bb313ac560 tests: Update packages to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 23:16:56 +01:00
Rolf Neugebauer
da3f1e9c6c Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 23:16:18 +01:00
Rolf Neugebauer
94bfb97ba3 tools: Update to the latest linuxkit/alpine
Skip tools/grub as this still requires alpine 3.8
to build

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-16 22:53:26 +01:00
Avi Deitcher
6e67121486 Merge pull request #3328 from deitch/grub-coreos
Move coreos-grub build to its own image
2019-04-16 21:04:30 +01:00
Avi Deitcher
99b785f3ee change image used by linuxkit output format for latest mkimage-*-efi
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2019-04-16 15:21:26 +01:00
Avi Deitcher
d6b80396bb Move coreos-grub build to its own image
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2019-04-15 13:00:52 +03:00
Rolf Neugebauer
2f3e42a68c Merge pull request #3327 from rn/containerd-1.2.6
Update containerd to v1.2.6
2019-04-14 14:49:27 +03:00
Rolf Neugebauer
c42569a570 Bump YAMLs to containerd v1.2.6 (and update runc)
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-14 11:29:43 +01:00
Rolf Neugebauer
53485a1f83 Bump packages to new alpine w/ containerd v1.2.6
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-14 11:29:08 +01:00
Rolf Neugebauer
fd67969697 pkg/runc: Bump to v1.0.0-rc7-6-g029124da
This is the recommended version for containerd v1.2.6

While at it, also bump the alpine base.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-14 11:29:08 +01:00
Rolf Neugebauer
2b32dde645 alpine: Bump containerd to v1.2.6
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-14 11:29:08 +01:00
Justin Cormack
916b20a919 Merge pull request #3326 from rn/kern-up
Update kernels to 5.0.7/4.19.34/4.14.111/4.9.168
2019-04-14 10:50:34 +01:00
Rolf Neugebauer
f670d0d352 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-13 23:23:42 +01:00
Rolf Neugebauer
74c8caa450 kernel: Update to 5.0.7/4.19.34/4.14.111/4.9.168
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-13 18:36:44 +01:00
Justin Cormack
bd9547fee6 Merge pull request #3323 from rn/kern-up
Update kernels to 5.0.6/4.19.33/4.14.110/4.9.167
2019-04-07 12:13:05 +01:00
Rolf Neugebauer
510f26581f tests: Use elfutils-dev for kmod tests
Commit 250b14661b ("kernel: Use elfutils-dev instead
of libelf-dev") switched the kernel build to use
elfutils-dev instead of libelf-dev. This caused the kernel
module tests to fail. The still installed libelf-dev and
the dunamically linked objtool (and friends) from the
kernel source package failed to execute.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-05 22:55:51 +01:00
Rolf Neugebauer
7f3b13aa92 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-05 20:57:22 +01:00
Rolf Neugebauer
250b14661b kernel: Use elfutils-dev instead of libelf-dev
With kernel 5.0.6 we start seeing compile errors such as:

  HOSTCXX -fPIC scripts/gcc-plugins/randomize_layout_plugin.o
In file included from <stdin>:1:
/usr/include/libelf/libelf.h:28:5: error: "__LIBELF_INTERNAL__" is not defined, evaluates to 0 [-Werror=undef]
 #if __LIBELF_INTERNAL__
     ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

elutils-dev installs a different version of libelf.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-05 19:01:51 +01:00
Justin Cormack
da1854050e Merge pull request #3322 from rn/mar-2019
March 2019 development report
2019-04-05 16:55:55 +01:00
Rolf Neugebauer
50a182936e March 2019 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-05 08:25:16 +01:00
Rolf Neugebauer
658da5b94a kernel: Update to 5.0.6/4.19.33/4.14.110/4.9.167
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-03 23:26:06 +01:00
Justin Cormack
9d4ebc8ada Merge pull request #3319 from rn/kern-up
Kernel update to 5.0.5/4.19.32/4.14.109/4.9.166
2019-04-01 11:19:19 +01:00
Rolf Neugebauer
1203c54c0a Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-31 22:21:42 +01:00
Rolf Neugebauer
32920fb018 Merge pull request #3317 from justincormack/dockerapi
Update Docker API version
2019-03-31 12:07:57 -07:00
Rolf Neugebauer
01b7472e98 kernel: Update to 5.0.5/4.19.32/4.14.109/4.9.166
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-31 19:45:53 +01:00
Rolf Neugebauer
5737db1429 Merge pull request #3315 from jmccoy555/master
Add static IP example
2019-03-31 11:30:01 -07:00
Justin Cormack
ec31261706 Update Docker API version
Signed-off-by: Justin Cormack <justin@specialbusservice.com>
2019-03-31 18:12:34 +01:00
mcy
91bd111dd0 Add static IP example
Signed-off-by: mcy <james@mcy.email>
2019-03-30 19:15:34 +00:00
Rolf Neugebauer
680de1eacf Merge pull request #3314 from rn/kern-up
Update kernels up to 5.0.4/4.19.31/4.14.108/4.9.165
2019-03-25 12:41:05 -07:00
Rolf Neugebauer
2853f71fe5 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-25 17:48:08 +00:00
Rolf Neugebauer
b1249c28ca kernel: Update to 5.0.4/4.19.31
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-25 09:11:10 +00:00
Rolf Neugebauer
e1b94133f1 kernel: Remove 4.20.x
It has been EOLed

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-25 09:07:29 +00:00
Rolf Neugebauer
edb8c29e8e kernel: Update to 5.03/4.20.17/4.19.30/4.14.108/4.9.165
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-24 23:21:29 +00:00
Rolf Neugebauer
f3e7087114 kernel: Enable BFQ in 5.x kernels
All our 4.x kernels had CFQ enabled. This was removed
in 5.x and replaced with BFQ. Enable it.

resolves #3308

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-24 13:41:33 +00:00
Rolf Neugebauer
cf5221eca9 kernel: Adjust 4.20.x/4.19.x x86 kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-24 13:14:18 +00:00
Rolf Neugebauer
0a8d501c41 kernel: Update to 5.02/4.20.16/5/19.29/4.14.107/4.9.164
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-24 13:00:34 +00:00
Rolf Neugebauer
aed0401150 kernel: Adjust 4.14.x/4.9.x config files
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-23 23:21:49 +00:00
Rolf Neugebauer
410aefb425 kernel: Update Intel microcode
Hmm, the URL changed, the md5 changed, but the date
on the website and the file stayed the same...

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-23 21:17:09 +00:00
Rolf Neugebauer
e5d8ded27e kernel: Update to 4.14106/4.9.163
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-23 19:38:49 +00:00
Rolf Neugebauer
8972f35d9a kernel: Remove 4.14.x for s390x and arm64
To reduce the number of kernels we maintain, for s390x
and ar64 we only support the latest LTS and newer kernels.
v4.19.x has been out for a while, so lets remove support for
v4.14.x.

resolves #3302

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-23 19:31:23 +00:00
Rolf Neugebauer
6bc3d2be2f Merge pull request #3310 from sethp/patch-1
Update example link
2019-03-23 11:24:54 -07:00
sethp
993b392bdd Update example link
The directory the link previously went to has changed.

Signed-off-by: Seth Pellegrino <seth@codecopse.net>
2019-03-20 21:58:12 -07:00
Justin Cormack
26e8a72674 Merge pull request #3305 from rn/kern-up
Add support for 5.0.x kernels and update to 4.20.15/4.19.28
2019-03-18 12:07:15 +00:00
Rolf Neugebauer
a43091d27a Merge pull request #3307 from jmccoy555/master
Updated Compose and Docker versions.
2019-03-17 16:16:16 -07:00
Rolf Neugebauer
29aee97416 tests: Update kernel-config check image
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-17 11:59:09 -07:00
Rolf Neugebauer
25e25da424 tests: Skip Moby kernel config checks on 5.x
See https://github.com/moby/moby/issues/38887
for details. Basically 5.x removed support for
CFQ with f382fb0bcef4 ("block: remove legacy IO
schedulers") and the Moby check still requires it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-17 11:56:46 -07:00
James McCoy
a43a3f7165 Updated Compose and Docker versions.
Signed-off-by: James McCoy <james@mcy.email>
2019-03-17 18:18:37 +00:00
Rolf Neugebauer
500c79b970 tests: Use latest moby kernel config test
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-17 11:05:01 -07:00
Rolf Neugebauer
bf81dec5cc tests: Adjust kernel config test for 5.x kernel
Many places where checking for -ge 4 and some minor version.
This will fail for 5.x kernels if their minor version is less.
Fix it.

While at it, also restructure/simplify the code, make it easier
to run against arbitrary kernel configs, and tidy up some
whitespaces.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-17 11:01:24 -07:00
Justin Cormack
9504b935e7 Merge pull request #3306 from ijc/containerd-v1.2.5
Containerd v1.2.5
2019-03-15 13:10:19 +00:00
Ian Campbell
66c72e7444 Bump yml to pickup containerd v1.2.5
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-03-14 10:29:29 +00:00
Ian Campbell
3510c792ea Bump packages to new alpine w/ containerd v1.2.5
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-03-14 10:18:56 +00:00
Ian Campbell
5e97fa4f69 alpine: Bump to containerd v1.2.5
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-03-13 07:15:23 -04:00
Rolf Neugebauer
3df49b9727 tests: Add tests for the 5.0.x kernel
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:29:48 +00:00
Rolf Neugebauer
72827bc860 Updates YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:29:41 +00:00
Rolf Neugebauer
419c808f07 kernel: Update to 4.20.15/4.19.28
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:29:31 +00:00
Rolf Neugebauer
74d9638275 kernel: Add support for the v5.0.x kernel
The kernel config files are 4.20.x config files run through
make oldconfig for the 5.0 kernel.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:29:19 +00:00
Rolf Neugebauer
d47b283df4 kernel: Remove fetch target
This target allowed to locally download the kernel source
tar balls. We haven't used this foir a while and adding
v5.x kernel support for it would add yet another conditional.

Remove it to keep the Makefile simpler.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:29:04 +00:00
Rolf Neugebauer
d79e8d9d6c kernel: Support v5.x kernels in kconfig build
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:28:49 +00:00
Rolf Neugebauer
9502197456 kernel: Add support for building v5.x kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:28:37 +00:00
Justin Cormack
b5c03581e7 Merge pull request #3304 from rn/feb-report
February 2019 report
2019-03-08 15:30:17 +00:00
Justin Cormack
51a75448d9 Merge pull request #3303 from rn/kern-up
Update kernel to 4.20.14/4.19.27/4,14.105/4.9.162
2019-03-08 13:15:29 +00:00
Rolf Neugebauer
1a954bc873 February 2019 report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-08 00:56:00 +00:00
Rolf Neugebauer
6f30b820a6 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-08 00:52:36 +00:00
Rolf Neugebauer
00b0abcf59 kernel: Update to 4.20.14/4.19.37/4.14.105/4.9.162
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-08 00:52:36 +00:00
Rolf Neugebauer
7d31ea1135 kernel: Reorder build targets to be in numerical order
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-08 00:52:36 +00:00
Rolf Neugebauer
05c8849a97 kernel: Build a 4.19 debug kernel on x86 (instead of 4.14)
We switched to 4.19.x as the default kernel and debug
kernel build was not updated. Fix it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-08 00:52:36 +00:00
Rolf Neugebauer
043faae78e Merge pull request #3298 from TiejunChina/master-dev
Enable Preempt-RT Linux 4.19.x into Linuxkit
2019-03-07 20:16:17 +00:00
Justin Cormack
ff9a659213 Merge pull request #3297 from rn/alpine_3.9
Update to Alpine Linux 3.9 (plus cadvisor and linux-firmware update)
2019-03-07 11:19:12 +00:00
Rolf Neugebauer
3228d21abf kernel: Update gcc version in 4.19.x and 4.20 kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-06 20:12:00 +00:00
Rolf Neugebauer
94cdfb55b6 kernel: Skip perf build for now
See https://github.com/linuxkit/linuxkit/issues/3299

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-06 01:04:54 +00:00
Rolf Neugebauer
d041e7d2bf kernel: Factor our perf build from main kernel build
The build of the perf utility has been quite bothersome,
with different arches and kernel versions failing.

Since we now have the ful kernel source in the package,
factor out the actual build into Dockerfile.perf

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-06 00:37:31 +00:00
Rolf Neugebauer
94516fe2a8 kernel: Remove libressl from kernel build Dockerfile
Alpine 3.9 no longer uses libressl

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-05 23:18:58 +00:00
Tiejun Chen
92ebe10a62 enable 4.19.x-rt with preempt-rt Linux 4.19.15
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2019-03-04 13:43:55 -08:00
Tiejun Chen
daab1a1ecc remove 4.14.x-rt stuff
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2019-03-04 13:43:48 -08:00
Rolf Neugebauer
a0e49c68bf src: De-lint run_packet.go
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 15:11:20 +00:00
Rolf Neugebauer
e71a88a929 src: De-lint scaleway code
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 15:09:13 +00:00
Rolf Neugebauer
e340827c5c src: De-lint push_aws.go
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 15:08:05 +00:00
Rolf Neugebauer
9f9252c3f3 src: De-lint run_qemu.go
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 15:07:05 +00:00
Rolf Neugebauer
27f8e8c850 cmd: de-lint moby/docker.go
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 15:03:37 +00:00
Rolf Neugebauer
7750ac10bf circleci: Bump go to 1.11
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 14:49:46 +00:00
Rolf Neugebauer
7c1952785d Update Authors
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 14:33:53 +00:00
Rolf Neugebauer
e8a80665dc examples: Update to Alpine 3.9
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 14:32:40 +00:00
Rolf Neugebauer
71f87cc6a9 Update package tags to the latest version
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 14:31:42 +00:00
Rolf Neugebauer
a53bfe1b81 tests: Disable the bpftrace test
The package does not build at the moment:
https://github.com/linuxkit/linuxkit/issues/3296

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 14:30:02 +00:00
Rolf Neugebauer
14039d0597 pkg/bpftrace: Disable the package
The compile fails with:

[ 30%] Building CXX object src/ast/CMakeFiles/ast.dir/codegen_llvm.cpp.o
[ 30%] Building CXX object src/ast/CMakeFiles/ast.dir/irbuilderbpf.cpp.o
[ 31%] Building CXX object src/ast/CMakeFiles/ast.dir/printer.cpp.o
[ 31%] Building CXX object src/ast/CMakeFiles/ast.dir/semantic_analyser.cpp.o
/bpftrace/src/ast/irbuilderbpf.cpp: In member function 'llvm::CallInst* bpftrace::ast::IRBuilderBPF::CreateProbeReadStr(llvm::AllocaInst*, size_t, llvm::Value*)':
/bpftrace/src/ast/irbuilderbpf.cpp:279:16: error: 'BPF_FUNC_probe_read_str' was not declared in this scope
       getInt64(BPF_FUNC_probe_read_str),
                ^~~~~~~~~~~~~~~~~~~~~~~
/bpftrace/src/ast/irbuilderbpf.cpp: In member function 'llvm::CallInst* bpftrace::ast::IRBuilderBPF::CreateProbeReadStr(llvm::Value*, size_t, llvm::Value*)':
/bpftrace/src/ast/irbuilderbpf.cpp:294:16: error: 'BPF_FUNC_probe_read_str' was not declared in this scope
       getInt64(BPF_FUNC_probe_read_str),
                ^~~~~~~~~~~~~~~~~~~~~~~
/bpftrace/src/ast/irbuilderbpf.cpp: In member function 'llvm::CallInst* bpftrace::ast::IRBuilderBPF::CreateGetCurrentCgroupId()':
/bpftrace/src/ast/irbuilderbpf.cpp:422:16: error: 'BPF_FUNC_get_current_cgroup_id' was not declared in this scope
       getInt64(BPF_FUNC_get_current_cgroup_id),
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/bpftrace/src/ast/irbuilderbpf.cpp: In member function 'llvm::CallInst* bpftrace::ast::IRBuilderBPF::CreateGetCurrentTask()':
/bpftrace/src/ast/irbuilderbpf.cpp:461:16: error: 'BPF_FUNC_get_current_task' was not declared in this scope
       getInt64(BPF_FUNC_get_current_task),
                ^~~~~~~~~~~~~~~~~~~~~~~~~
/bpftrace/src/ast/irbuilderbpf.cpp: In member function 'llvm::CallInst* bpftrace::ast::IRBuilderBPF::CreateGetStackId(llvm::Value*, bool)':
/bpftrace/src/ast/irbuilderbpf.cpp:497:16: error: 'BPF_FUNC_get_stackid' was not declared in this scope
       getInt64(BPF_FUNC_get_stackid),
                ^~~~~~~~~~~~~~~~~~~~
/bpftrace/src/ast/semantic_analyser.cpp: In member function 'int bpftrace::ast::SemanticAnalyser::create_maps(bool)':
/bpftrace/src/ast/semantic_analyser.cpp:871:68: error: 'BPF_MAP_TYPE_STACK_TRACE' was not declared in this scope
       bpftrace_.stackid_map_ = std::make_unique<bpftrace::FakeMap>(BPF_MAP_TYPE_STACK_TRACE);
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
/bpftrace/src/ast/semantic_analyser.cpp:885:64: error: 'BPF_MAP_TYPE_STACK_TRACE' was not declared in this scope
       bpftrace_.stackid_map_ = std::make_unique<bpftrace::Map>(BPF_MAP_TYPE_STACK_TRACE);
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/ast/CMakeFiles/ast.dir/build.make:89: src/ast/CMakeFiles/ast.dir/irbuilderbpf.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/ast/CMakeFiles/ast.dir/build.make:115: src/ast/CMakeFiles/ast.dir/semantic_analyser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:276: src/ast/CMakeFiles/ast.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 14:02:09 +00:00
Rolf Neugebauer
82d6f949c7 pkg/firmware: Update to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 12:25:40 +00:00
Rolf Neugebauer
0552c47a26 pkg/cadvisor: Update to v0.33.0
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 12:25:40 +00:00
Rolf Neugebauer
4fdad53190 pkgs: Update packages to the latest linuxkit/alpine
except for bpftrace, since it does not compile:
https://github.com/linuxkit/linuxkit/pull/3230

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 12:25:40 +00:00
Rolf Neugebauer
9a9d9670e8 kernel: Update build to use the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 11:18:21 +00:00
Rolf Neugebauer
d341fdc666 tools/alpine: Update the package
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 06:16:57 -05:00
Rolf Neugebauer
f0815f755a tools/alpine: Add more wireguard packages
The wireguard package has some sub-packages which are
now dependencies. Include them in the alpine base.

Also include openresolv, which is required by one
of the wireguard packages.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 10:28:57 +00:00
Rolf Neugebauer
d236874874 tool: Fix azure.go gofmt
Looks like the newer gofmt is a little pickier.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 09:41:10 +00:00
Rolf Neugebauer
c52e831dca tests: Update alpine 3.8 to 3.9
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 09:41:10 +00:00
Rolf Neugebauer
f0ee28cd6e tests: Update packages to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-03 09:40:57 +00:00
Rolf Neugebauer
903ff4ef64 Update use of test packages to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 19:57:53 +00:00
Rolf Neugebauer
75422a7ca8 tests: Update packages to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 19:19:13 +00:00
Rolf Neugebauer
5910713bae Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 19:18:46 +00:00
Rolf Neugebauer
4f715f5f2a tools: Update to the latest linuxkit/alpine
Skip the packages which use grub to boot EFI images.

The grub build fails, see:
https://github.com/linuxkit/linuxkit/issues/3295

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 19:06:59 +00:00
Rolf Neugebauer
f6f13d6c4b tools/alpine: Update to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 18:27:03 +00:00
Rolf Neugebauer
c217a7c7d1 tools/alpine: Move strace to x86 and arm64 only
It does not seem to be avail on s390x

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 17:57:02 +00:00
Rolf Neugebauer
ec5e383de4 tools/alpine: Update to Alpine Linux 3.9
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-02 10:39:31 +00:00
Justin Cormack
b46ec8a906 Merge pull request #3294 from rn/kern-up
Update kernels to 4.20.13/4.19.26/4.14.104/4.9.161
2019-03-02 10:37:20 +00:00
Rolf Neugebauer
376cb1000a Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-01 19:24:42 +00:00
Rolf Neugebauer
1e916001f0 kernel: Adjust kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-01 08:33:49 +00:00
Rolf Neugebauer
5a1e83e639 kernel: Update to 4.20.13/4.19.26/4.14.104/4.9.161
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-01 08:06:52 +00:00
Rolf Neugebauer
731b796fa9 Merge pull request #3293 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20190227
2019-02-28 09:11:06 +00:00
Jason A. Donenfeld
572c7c221a wireguard: upgrade to 0.0.20190227
* wg-quick: freebsd: allow loopback to work

FreeBSD adds a route for point-to-point destination addresses. We don't
really want to specify any destination address, but unfortunately we
have to. Before we tried to cheat by giving our own address as the
destination, but this had the unfortunate effect of preventing
loopback from working on our local ip address. We work around this with
yet another kludge: we set the destination address to 127.0.0.1. Since
127.0.0.1 is already assigned to an interface, this has the same effect
of not specifying a destination address, and therefore we accomplish the
intended behavior. Note that the bad behavior is still present in Darwin,
where such workaround does not exist.

* tools: remove unused check phony declaration
* highlighter: when subtracting char, cast to unsigned
* chacha20: name enums
* tools: fight compiler slightly harder
* tools: c_acc doesn't need to be initialized
* queueing: more reasonable allocator function convention

Usual nits.

* systemd: wg-quick should depend on nss-lookup.target

Since wg-quick(8) calls wg(8) which does hostname lookups, we should
probably only run this after we're allowed to look up hostnames.

* compat: backport ALIGN_DOWN
* noise: whiten the nanoseconds portion of the timestamp

This mitigates unrelated sidechannel attacks that think they can turn
WireGuard into a useful time oracle.

* hashtables: decouple hashtable allocations from the main device allocation

The hashtable allocations are quite large, and cause the device allocation in
the net framework to stall sometimes while it tries to find a contiguous
region that can fit the device struct. To fix the allocation stalls, decouple
the hashtable allocations from the device allocation and allocate the
hashtables with kvmalloc's implicit __GFP_NORETRY so that the allocations fall
back to vmalloc with little resistance.

* chacha20poly1305: permit unaligned strides on certain platforms

The map allocations required to fix this are mostly slower than unaligned
paths.

* noise: store clamped key instead of raw key

This causes `wg show` to now show the right thing. Useful for doing
comparisons.

* compat: ipv6_stub is sometimes null

On ancient kernels, ipv6_stub is sometimes null in cases where IPv6 has
been disabled with a command line flag or other failures.

* Makefile: don't duplicate code in install and modules-install
* Makefile: make the depmod path configurable

* queueing: net-next has changed signature of skb_probe_transport_header

A 5.1 change. This could change again, but for now it allows us to keep this
snapshot aligned with our upstream submissions.

* netlink: don't remove allowed ips for new peers
* peer: only synchronize_rcu_bh and traverse trie once when removing all peers
* allowedips: maintain per-peer list of allowedips

This is a rather big and important change that makes it much much faster to do
operations involving thousands of peers. Batch peer/allowedip addition and
clearing is several orders of magnitude faster now.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-28 00:35:24 +01:00
Justin Cormack
3441f4f333 Merge pull request #3292 from rn/kern-up
Update kernels to 4.20.12/4.19.25/4.14.103/4.9.160
2019-02-25 10:10:27 +00:00
Rolf Neugebauer
6b988171cf Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-24 23:21:42 +00:00
Rolf Neugebauer
9440e48f4f kernels: Update to 4.20.12/4.19.25/4.14.103/4.9.160
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-24 19:48:17 +00:00
Rolf Neugebauer
882ee6afb5 kernels: Update to 4.20.11/4.19.24/4.14.102/4.9.159
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-24 13:12:28 +00:00
Rolf Neugebauer
402d712ed6 kernel: Adjust 4.9.x kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-24 10:20:43 +00:00
Rolf Neugebauer
0ebc73d57f kernels: Update to 4.20.10/4.19.23/4.14.101/4.9.158
This skiks 4.20.9/4.19.22/4.14.100/4.9.157 because they
contained a bug. See:
https://lwn.net/Articles/779934/

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-23 13:26:12 +00:00
Rolf Neugebauer
fee4e492fd kernels: Update to 4.20.8/4.19.21/4.14.99/4.19.156
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-23 09:47:19 +00:00
Ian Campbell
6b17ff4ff2 Merge pull request #3290 from ijc/containerd-v1.2.4
Containerd v1.2.4
2019-02-14 13:12:18 +00:00
Ian Campbell
16df1af139 Bump yml to pickup containerd v1.2.4
Also pick a newer version of runc.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-14 10:16:47 +00:00
Ian Campbell
39ee6c0e9b Bump packages to new alpine w/ containerd v1.2.4
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-14 10:01:33 +00:00
Ian Campbell
24c13f222c Bump runc to version from containerd v1.2.4
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-14 10:01:33 +00:00
Ian Campbell
236d68f409 alpine: Bump to containerd v1.2.4
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-14 05:01:19 -05:00
Ian Campbell
f3ec48417c Redirect $TMPDIR when running containerd tests
These tests expect a $TMPDIR which supports user xattrs, which the tmpfs on
/tmp does not. Redirect it to the persistent disk which does.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-13 11:41:40 +00:00
Ian Campbell
b5c6c3ceeb test/pkg/containerd: move config to build.yml
... from the old-skool label scheme.

No semantic change intended. Some keys are in different orders and the "mounts"
entry gained an empty "destination" key, neither of which makes a practical
difference.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-13 11:41:12 +00:00
Justin Cormack
1fb71a127e Merge pull request #3286 from ijc/containerd-v1.2.3
Containerd v1.2.3
2019-02-11 11:47:58 +00:00
Ian Campbell
6e16071bfe Bump yml to pickup containerd v1.2.3
Also pick a newer version of runc.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-11 10:05:14 +00:00
Ian Campbell
61ff76a7e3 Bump packages to new alpine w/ containerd v1.2.3
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-11 09:47:37 +00:00
Ian Campbell
d56442cf2e Bump runc to version from containerd v1.2.3
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-11 09:47:36 +00:00
Ian Campbell
baa56f8b22 alpine: Bump to containerd v1.2.3
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-02-11 04:47:22 -05:00
Justin Cormack
af6cad2ca6 Merge pull request #3285 from rn/kern-up
Kernel update to 4.20.7/4.19.20/4.14.98/4.9.155
2019-02-09 15:06:49 +00:00
Rolf Neugebauer
f408d6cfee iUpdate YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-09 10:40:09 +00:00
Rolf Neugebauer
5ffa60f639 kernel: Update to 4.20.7/4.19.20/4.14.98/4.9.155
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-08 23:25:28 +00:00
Rolf Neugebauer
1d19a27e08 Merge pull request #3238 from kppk/master
Add support for named pipes to init
2019-02-08 10:04:28 +00:00
Tomas Knappek
e62a6b3e51 Update YAMLs to latest init
Signed-off-by: Tomas Knappek <tomas.knappek@gmail.com>
2019-02-07 10:38:42 -08:00
Tomas Knappek
63a6a60fed Fixes linuxkit#3237: add support for named pipes to init
Signed-off-by: Tomas Knappek <tomas.knappek@gmail.com>
2019-02-07 10:37:15 -08:00
Rolf Neugebauer
c44cf1293f Merge pull request #3253 from johanneswuerbach/s390x-support
Add s390x support to binfmt_misc
2019-02-07 00:20:19 +00:00
Johannes Würbach
a10227ab28 Update linuxkit/binfmt references
Signed-off-by: Johannes Würbach <johannes.wuerbach@googlemail.com>
2019-02-06 10:17:55 +01:00
Rolf Neugebauer
5aea2afb8b Merge pull request #3284 from rn/jan-2019
January 2019 development report
2019-02-06 08:31:45 +00:00
Rolf Neugebauer
2f6e864149 January 2019 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-05 23:52:48 +00:00
Rolf Neugebauer
f77af9bd3b Merge pull request #3281 from rn/kern-up
Update kernels to 4.20.6/4.19.19/4.14.97/4.9.154
2019-02-04 10:44:16 +00:00
Rolf Neugebauer
235639999b Merge pull request #3283 from rn/author
Update Authors
2019-02-02 18:26:49 +00:00
Rolf Neugebauer
5f9cd0eb16 Update Authors
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-02 11:12:41 +00:00
Rolf Neugebauer
13f63bf9f7 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-02 11:03:39 +00:00
Rolf Neugebauer
1c49fa2c8f kernels: Update to 4.20.6/4.19.19/4.14.97/4.9.154
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-02-01 19:34:57 +00:00
Rolf Neugebauer
c5b3f24de6 Merge pull request #3279 from rn/kern-up
Kernel update to 4.20.5/4.19.18/4.14.96/4.9.153
2019-01-29 10:51:15 +00:00
Rolf Neugebauer
a10fba6f62 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-29 08:22:32 +00:00
Rolf Neugebauer
405500aac0 kernels: Adjust 4.14.x config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-28 19:34:27 +00:00
Rolf Neugebauer
ab527e7afb kernels: Update to 4.2.5/4.19.18/4.14.96/4.9.153
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-28 18:20:01 +00:00
Justin Cormack
6fcfc99e4d Merge pull request #3277 from rn/kern-up
Update kernels to 4.20.4/4.19.17/4.14.95/4.9.152
2019-01-27 15:27:56 +00:00
Rolf Neugebauer
4018bbcbfd Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-26 10:00:21 +00:00
Rolf Neugebauer
f85b16e0bd kernel: Update to 4.20.4/4.19.17/4.14.95/4.9.152
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-25 20:16:00 +00:00
Rolf Neugebauer
9a2d651407 Merge pull request #3276 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20190123
2019-01-23 23:06:20 +00:00
Jason A. Donenfeld
a94099639e wireguard: upgrade to 0.0.20190123
* tools: curve25519: handle unaligned loads/stores safely

This should fix sporadic crashes with `wg pubkey` on certain architectures.

* netlink: auth socket changes against namespace of socket

In WireGuard, the underlying UDP socket lives in the namespace where the
interface was created and doesn't move if the interface is moved. This
allows one to create the interface in some privileged place that has
Internet access, and then move it into a container namespace that only
has the WireGuard interface for egress. Consider the following
situation:

1. Interface created in namespace A. Socket therefore lives in namespace A.
2. Interface moved to namespace B. Socket remains in namespace A.
3. Namespace B now has access to the interface and changes the listen
port and/or fwmark of socket. Change is reflected in namespace A.

This behavior is arguably _fine_ and perhaps even expected or
acceptable. But there's also an argument to be made that B should have
A's cred to do so. So, this patch adds a simple ns_capable check.

* ratelimiter: build tests with !IPV6

Should reenable building in debug mode for systems without IPv6.

* noise: replace getnstimeofday64 with ktime_get_real_ts64
* ratelimiter: totalram_pages is now a function
* qemu: enable FP on MIPS

Linux 5.0 support.

* keygen-html: bring back pure javascript implementation

Benoît Viguier has proofs that values will stay well within 2^53. We
also have an improved carry function that's much simpler. Probably more
constant time than emscripten's 64-bit integers.

* contrib: introduce simple highlighter library

This is the highlighter library being used in:
- https://twitter.com/EdgeSecurity/status/1085294681003454465
- https://twitter.com/EdgeSecurity/status/1081953278248796165

It's included here as a contrib example, so that others can paste it into
their own GUI clients for having the same strictly validating highlighting.

* netlink: use __kernel_timespec for handshake time

This readies us for Y2038. See https://lwn.net/Articles/776435/ for more info.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23 14:50:55 +01:00
Rolf Neugebauer
9a818a1446 Merge pull request #3273 from errordeveloper/fix-zfs-4.14.x
Use latest stable release of ZFS
2019-01-21 20:00:58 +00:00
Ilya Dmitrichenko
872a92849b Use latest stable release of ZFS
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2019-01-19 10:04:34 +00:00
Rolf Neugebauer
5cf518b89b Merge pull request #3272 from rn/kern-up
Update kernels to 4.20.3/4.19.16/4.14.94/4.9.151
2019-01-18 10:34:26 +00:00
Rolf Neugebauer
c28d72169d Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-18 08:12:55 +00:00
Rolf Neugebauer
eeb2d546d1 Merge pull request #3249 from chriswue/master
Adding support to mount an encrypted filesystem
2019-01-18 01:28:50 +01:00
Christian Wuerdig
a9bc7372de Adding dm-crypt as core pkg
Signed-off-by: Christian Wuerdig <christian.wuerdig@gmail.com>
2019-01-18 11:56:18 +13:00
Rolf Neugebauer
ffd8d19cfd kernel: Update to 4.20.3/4.19.16/4.14.94/4.9.151
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-17 19:51:32 +00:00
Rolf Neugebauer
6412cfa117 Merge pull request #3271 from rn/kern-up
Update kernel to 4.20.2/4.19.15/4.14.93/4.9.150
2019-01-17 17:12:10 +01:00
Rolf Neugebauer
567d4e2f54 Update YAMLs to latest kernels
This also fixes up test/cases/020_kernel/110_namespace/common.yml
and test/cases/040_packages/032_bcc/test.yml to use the 4.19.x
kernel. I missed these when making the 4.19 kernel the default.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-17 11:56:04 +00:00
Rolf Neugebauer
3b4f70dd76 kernel: Update to 4.20.2/4.19.15/4.14.93/4.9.150
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-16 22:28:57 +00:00
Rolf Neugebauer
49ed462379 Merge pull request #3269 from rn/def-kern
Switch the default kernel to 4.19.x
2019-01-16 21:08:18 +01:00
Rolf Neugebauer
6ab6467d78 Switch the default kernel to 4.19.x
4.19.x is the new LTS kernel and has been out for a while. Switch
all examples and tests to using it instead of the 4.14.x kernel.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-16 16:30:24 +00:00
Rolf Neugebauer
8aee979b72 Merge pull request #3267 from TiejunChina/master-dev
update -rt to 4.14.87-rt50
2019-01-15 12:23:09 +01:00
Tiejun Chen
ef9302bc01 update -rt to 4.14.87-rt50
Signed-off-by: Tiejun Chen <tiejunc@vmware.com>
2019-01-14 20:49:28 -08:00
Rolf Neugebauer
13bfb5c238 Merge pull request #3265 from rn/kern-up
Update kernels to 4.20.1/4.19.14/4.14.92/4.9.149
2019-01-14 12:29:56 +01:00
Christian Wuerdig
8cd16c4904 Adding losetup utility package to core pkg
Signed-off-by: Christian Wuerdig <christian.wuerdig@gmail.com>
2019-01-14 06:24:00 +13:00
Rolf Neugebauer
4b66ef2e2a Merge pull request #3266 from bensallen/master
Fix link to ADOPTERS.md
2019-01-12 19:33:57 +01:00
Ben Allen
c0049f051d Fix link to ADOPTERS.md
Signed-off-by: Ben Allen <bsallen@alcf.anl.gov>
2019-01-12 12:25:40 -06:00
Rolf Neugebauer
4d20f2c476 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-12 18:01:24 +00:00
Rolf Neugebauer
be99dbcda2 kernel: Adjust the 4.20/4.19 configs for x86 and arm64
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-12 13:28:22 +00:00
Rolf Neugebauer
d9504a7904 kernel: Update to 4.20.1/4.19.14/4.14.92/4.9.149
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-12 11:55:36 +00:00
Ian Campbell
eb7e07542f Merge pull request #3262 from ijc/containerd-v1.2.2
Containerd v1.2.2
2019-01-09 10:01:57 +00:00
Ian Campbell
7386a32afe pkg/runc: bump alpine base to newest one.
Corresponding to the similar changes in ed2dd46cd0.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-08 16:28:36 +00:00
Ian Campbell
3a3b742ca3 Bump yml to pickup containerd v1.2.2
Also pick a newer version of runc.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-08 12:13:36 +00:00
Ian Campbell
ddd8c0c017 Bump runc to version from containerd v1.2.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-08 11:52:42 +00:00
Ian Campbell
ed2dd46cd0 Bump packages to new alpine w/ containerd v1.2.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-08 11:52:42 +00:00
Ian Campbell
b4187fe6ea alpine: Bump to containerd v1.2.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-08 06:52:27 -05:00
Ian Campbell
c52e20a932 tools/alpine: Grab another file needed for wireguard APK build.
Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-08 11:37:13 +00:00
Rolf Neugebauer
c033d6892e Merge pull request #3260 from TiejunChina/master-dev
update -rt to 4.14.87-rt49
2019-01-08 10:46:47 +01:00
Tiejun Chen
e7481213e4 update -rt to 4.14.87-rt49
Signed-off-by: Tiejun Chen <tiejunc@vmware.com>
2019-01-06 13:29:54 -08:00
Justin Cormack
bfb37f20b1 Merge pull request #3257 from keyki/master
log the actual error message when creating the Docker API client
2019-01-05 19:25:49 +00:00
Justin Cormack
0956685d44 Merge pull request #3259 from rn/report-dec-2018
December 2018 development report
2019-01-04 09:53:18 +00:00
Rolf Neugebauer
b0bf58f073 December 2018 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-04 09:06:02 +00:00
Justin Cormack
246a491e3c Merge pull request #3258 from rn/kern-4.20
Remove 4.4.x kernels, add 4.20.x kernels
2019-01-03 11:04:35 +00:00
Rolf Neugebauer
eb0fa4b150 tests: Add kernel module test for 4.20.x
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-03 00:47:29 +00:00
Rolf Neugebauer
8069c88396 tests: Add 4.20.x kernel config test
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-03 00:44:28 +00:00
Rolf Neugebauer
77422d26c0 kernel/arm64: Enable ENA driver
The new AWS A1 instances use the ENA network driver.
Enable it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-02 22:17:36 +00:00
Rolf Neugebauer
ae1f2dd6af kernel/x86_64,arm64: Enable STACKLEAK GCC plugin
Enable the STACKLEAK GCC plugin which erases the
kernel stack before returning from system calls.
This security options has a reported performance
hit of around 1% which seem like a reasonable amount.

For more details see: https://outflux.net/blog/archives/2018/12/24/security-things-in-linux-v4-20/

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-02 22:17:36 +00:00
Rolf Neugebauer
ce3dc79509 kernel: Add support for 4.20.x kernels
The kernel config was derived from the 4.19.13 kernel config
run through the 'make oldconfig' with all defaults accepted,
except for:
- NET_VENDOR_MICROCHIP (defauly 'y', set to 'n')

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-02 22:17:36 +00:00
Rolf Neugebauer
6c59e083f4 kernel: Simplify perf and bcc build logic
Since we removed the 4.4.x kernel, simply don't build
perf and bcc for 4.9.x kernels.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-02 22:17:36 +00:00
Krisztian Horvath
c68f52c76f log: log the actual error message when creating the Docker API client
Signed-off-by: Krisztian Horvath <keyki.kk@gmail.com>
2019-01-02 17:12:40 +01:00
Rolf Neugebauer
2ab3b0a24e Remove 4.4 kernel
We already have 4.9.x, 4.14.x, and 4,19.x as LTS releases.
4.9.x has a longer lifetime as 4.4.x as well and fewer security
fixes can be backported to 4.4.x. Remove it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-01-01 17:06:06 +00:00
Justin Cormack
cf20f3d66b Merge pull request #3256 from rn/kern-up
Update kernels to 4.19.13/4.14.91/4.9.148
2018-12-31 12:21:16 +00:00
Rolf Neugebauer
78e05de197 Update YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-31 00:07:02 +00:00
Rolf Neugebauer
8ba5e2416d kernel: Update to 4.19.13/4.14.92/4.9.148
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-30 21:06:50 +00:00
Rolf Neugebauer
2b826be453 Merge pull request #3255 from rn/repeat
Initial support for reproducible builds
2018-12-30 11:27:51 +00:00
Rolf Neugebauer
416ccd6f5d docs: Dev reports are monthly not weekly
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 15:46:57 +00:00
Rolf Neugebauer
3da93a3c7a docs: Link reproducible build doc from top-level README
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 15:43:50 +00:00
Rolf Neugebauer
e7b85b6589 docs: Add details about reproducible builds
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 15:38:02 +00:00
Rolf Neugebauer
8008811aad tests: Add tests for reproducible builds
Test the 'tar' and 'kernel+initrd' formats for now.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 14:10:38 +00:00
Rolf Neugebauer
78281af751 build: Make list of mounts deterministic
Sort the list of mount points by destination. This makes the list
deterministic for reproducible builds and also ensures that, e.g.,
the mount for /dev happens before the mount for /dev/pts.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 14:10:38 +00:00
Rolf Neugebauer
2fec949cd9 build: Make list of capabilities deterministic
Sort list of capabilities that go into config.json.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 14:10:38 +00:00
Rolf Neugebauer
93596225da build: Fix timestamp of files created by 'docker export'
Currently 'docker export' is used to convert a linuxkit entry
in the YAML file to a tar file of the root filesystem. This
process creates a number of files and directories which have
the timestamp of when the 'docker export' is run. Fix 'em up.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 14:10:38 +00:00
Rolf Neugebauer
5cbc156faf build: Improve debug output
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 14:10:38 +00:00
Rolf Neugebauer
02579b22e5 build: Fix the ModTime for files created during build
When creating files for the "intermediate" tar ball,
fix the ModTime. This reduces the difference between
LinuxKit images build from identical inputs.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-29 14:10:38 +00:00
Justin Cormack
1616b18fb0 Merge pull request #3252 from rn/kern-up
Update kernels to 4.19.12/4.14.90/4.9.147/4.4.169
2018-12-23 10:08:47 +00:00
Johannes Würbach
81d17a19c4 Add s390x support to binfmt_misc
Signed-off-by: Johannes Würbach <johannes.wuerbach@googlemail.com>
2018-12-22 22:50:37 +01:00
Rolf Neugebauer
618c8675e3 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-22 13:29:37 +00:00
Rolf Neugebauer
4863059b7e kernels: Enable Netronome drivers for x86/arm64
packet.net will soon have x86 and arm64 machines with NFPs.
Enable the driver for it.

The 4.9 kernel only has support for the NFP VF driver,
so don't enable it there.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-22 11:11:27 +00:00
Rolf Neugebauer
6bda9db3fc kernel: Adjust kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-22 11:04:51 +00:00
Rolf Neugebauer
cdcfcb7347 kernel: Update to 4.19.12/4.14.90/4.9.147/4.4.169
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-22 10:19:45 +00:00
Rolf Neugebauer
4e634e3b29 Merge pull request #3173 from duraki/3172-enable-CAN
Enable CAN networking subsystem
2018-12-20 23:47:31 +00:00
Rolf Neugebauer
5b5f272890 Merge pull request #3205 from alicefr/fix_qemu_dockerfile
Missing s390x in the switch for qemu Dockerfile
2018-12-20 23:45:14 +00:00
Rolf Neugebauer
9d1838d812 Merge pull request #3235 from kkroo/qemu_usb
Add qemu USB device pass through
2018-12-20 23:42:53 +00:00
Rolf Neugebauer
884ec0ad0e Merge pull request #3248 from rn/kern-up
Update kernels to 4.9.11/4.14.89/4.9.146/4.4.168
2018-12-20 23:41:16 +00:00
Rolf Neugebauer
42bb50d22b Update YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-20 00:58:15 +00:00
Rolf Neugebauer
4ae342c097 kernel: Update to 4.19.11/4.14.89/4.9.146/4.4.168
Note this skips 4.19.10. The diff is pretty small.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-19 22:28:00 +00:00
Rolf Neugebauer
581e924e13 Merge pull request #3247 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20181218
2018-12-18 22:16:56 +00:00
Jason A. Donenfeld
4621b91939 wireguard: upgrade to 0.0.20181218
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-18 18:06:35 +01:00
Rolf Neugebauer
3f164b3648 Merge pull request #3246 from fntlnz/update-influxdb
Update InfluxDB example to 1.7
2018-12-17 08:24:33 +00:00
Lorenzo Fontana
344b27ab4f Update InfluxDB example to 1.7
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-12-17 00:23:32 +01:00
Rolf Neugebauer
2ee84cbac7 Merge pull request #3244 from rn/kern-up
Update kernel to 4.19.9/4.14.88/4.9.145/4.4.167
2018-12-14 11:03:19 +00:00
Rolf Neugebauer
9c0e356d2c Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-14 01:18:30 +00:00
Rolf Neugebauer
65e2c50b88 kernel: Update to 4.19.9/4.14.88/4.9.145/4.4.167
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-13 23:24:01 +00:00
Rolf Neugebauer
52d2d21501 Merge pull request #3243 from rn/kern-up
Kernel update to 4.19.8/4.14.87/4.9.144
2018-12-09 19:40:29 +00:00
Rolf Neugebauer
1d92c003f9 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-09 17:53:48 +00:00
Rolf Neugebauer
a26ff89ce8 kernel: Update to 4.19.8/4.14.87/4.9.144
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-09 13:46:31 +00:00
Rolf Neugebauer
b987627a1f Merge pull request #3230 from simar7/bpftrace-pkg
pkg/bpftrace: Add bpftrace as a core pkg
2018-12-08 09:44:35 +00:00
Simarpreet Singh
5c4523939b pkg/bpftrace: Add a trivial test for pkg/bpftrace
Signed-off-by: Simarpreet Singh <simar@linux.com>
2018-12-07 15:18:06 -08:00
Simarpreet Singh
3e0686e5c2 pkg/bpftrace: Add bpftrace as a core pkg
Signed-off-by: Simarpreet Singh <simar@linux.com>
2018-12-07 14:31:43 -08:00
Rolf Neugebauer
7dab747345 Merge pull request #3242 from rn/kern-up
Update kernels to 4.19.7/4.14.86/4.9.143
2018-12-07 13:44:40 +00:00
Rolf Neugebauer
a5e65cfeea Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-07 00:36:45 +00:00
Rolf Neugebauer
055c0f8403 kernel: Tweak the x86 kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-06 21:55:49 +00:00
Rolf Neugebauer
765cf6c917 kernel: Update to 4.19.7/4.14.86/4.9.143
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-06 20:38:45 +00:00
Rolf Neugebauer
953e63ec55 Merge pull request #3239 from rn/kern-up
Update kernels up to 4.19.6/4.14.85/4.9.142/4.4.166
2018-12-06 15:27:20 +00:00
Justin Cormack
9fbf50c303 Merge pull request #3240 from rn/nov-2018
November 2018 development report
2018-12-06 13:46:58 +01:00
Rolf Neugebauer
37db2de25d November 2018 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-04 19:12:17 +00:00
Rolf Neugebauer
2a1f90fff1 Update YAMLs to latest kernel
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-04 08:32:56 +00:00
Rolf Neugebauer
2b6a0e15bb kernel: Update to 4.19.6/4.14.85/4.9.142/4.4.166
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-03 23:51:48 +00:00
Rolf Neugebauer
1d405ae5cf kernel: Update to 4.19.5/4.14.84/4.9.141/4.4.165
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-12-03 22:03:55 +00:00
Omar Ramadan
71808a004d Add qemu USB devices
Signed-off-by: Omar Ramadan <omar.ramadan93@gmail.com>
2018-11-27 09:39:12 -08:00
Rolf Neugebauer
ed57c3d1e2 Merge pull request #3234 from rn/kern-up
Update kernels to 4.19.3/4.18.20/4.14.82/4.9.138/4.4.164
2018-11-26 13:46:29 -08:00
Rolf Neugebauer
7f22f68152 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-24 14:41:48 +00:00
Rolf Neugebauer
63cfbb28d2 kernel: Disable ACPI_WMI for x86
WMI is mostly used for laptops and not relevant for
VMs and servers. Disable it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-23 23:59:15 +00:00
Rolf Neugebauer
70f320db20 kernels: Update to 4.19.4/4,14.83/4.9.140
This skips 4.9.139 which is just two revert commits from
4.9.140.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-23 23:44:34 +00:00
Rolf Neugebauer
28ce2bbdca kernel: Remove support for 4.18.x
4.18.20 was the last 4.18.x release. Remove it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-23 23:40:44 +00:00
Rolf Neugebauer
07064da303 Update YAMLs to lates kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-23 20:13:55 +00:00
Justin Cormack
36aa581400 Merge pull request #3225 from rn/vmlinux
Add experimental support for building uncompressed kernels
2018-11-23 11:18:19 +00:00
Rolf Neugebauer
f1667aac67 contrib: Update crosvm README
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-22 23:03:26 +00:00
Rolf Neugebauer
fa719063a8 contrib: Update crosvm to latest version
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-22 23:03:26 +00:00
Rolf Neugebauer
f635cad7a6 build: Add support for decompressing bzLinux kernels
Support plain gzip'ed files, as used on arm64, and bzImage with
embedded gzip'ed kernel, as used on x86.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-22 23:03:26 +00:00
Rolf Neugebauer
1257fd9ce9 kernel: Adjust 4.4 config for x86
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-22 22:42:00 +00:00
Rolf Neugebauer
ab3f4950aa kernel: Adjust arm64 4.14 config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-22 22:06:44 +00:00
Rolf Neugebauer
92d6966307 kernel: Updat to 4.19.3/4.18.20/4.14.82/4.9.138/4.4.164
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-22 20:44:45 +00:00
Rolf Neugebauer
09fbcb59d7 cmd: Add scaffolding to decompress the kernel
Add the '-vmlinux' flag to build and pass it all
the way to the kernel filter.

Note, this commit only adds the flag but does not
yet perform the decompression. This will be added
with the next commit.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-20 21:22:49 +00:00
Rolf Neugebauer
4f0cec5c14 build: Restructure the kernel filter
Stash the kernel image in a local buffer and
flush it out once done.

This is preparation work for supporting uncompressed
kernels in the next commit.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-20 21:22:49 +00:00
Rolf Neugebauer
a33d8024cb Merge pull request #3232 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20181119
2018-11-19 19:36:14 +00:00
Jason A. Donenfeld
dfc05c676f wireguard: upgrade to 0.0.20181119
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-19 18:30:34 +01:00
Rolf Neugebauer
82a4b54290 Merge pull request #3231 from TiejunChina/master-dev
update -rt to 4.14.78-rt47
2018-11-19 08:26:45 +00:00
Tiejun Chen
116f9be99b update -rt to 4.14.78-rt47
Signed-off-by: Tiejun Chen <tiejunc@vmware.com>
2018-11-18 15:56:01 -08:00
Justin Cormack
8e205102b6 Merge pull request #3229 from rn/kern-up
Kernel update to 4.19.2/14.18.19/4.14.81/4.9.137
2018-11-16 10:35:31 +00:00
Rolf Neugebauer
fc571c65a8 Merge pull request #3228 from asbjornenge/patch-1
Update ADOPTERS.md
2018-11-16 08:48:35 +00:00
Asbjorn Enge
0e53147270 Update ADOPTERS.md
Added us 😄👍

Signed-off-by: Asbjørn Enge <asbjorn@hanafjedle.net>
2018-11-16 08:40:46 +01:00
Rolf Neugebauer
c0b826c088 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-16 00:55:38 +00:00
Rolf Neugebauer
535cbfaf32 kernel: Adjust 4.18.x kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-15 22:54:05 +00:00
Rolf Neugebauer
8b816a87a5 kernel: Adjust 4.19.x kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-15 22:14:28 +00:00
Rolf Neugebauer
9482281f5b kernel: Update to 4.19.2/4.18.19/4.14.81/4.9.137
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-15 22:11:30 +00:00
Rolf Neugebauer
1d2389b20f Merge pull request #3227 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20181115
2018-11-15 22:10:14 +00:00
Jason A. Donenfeld
7494396812 wireguard: upgrade to 0.0.20181115
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-15 12:13:38 -08:00
Justin Cormack
67fdff0c4e Merge pull request #3226 from justincormack/adopters
Add incomplete ADOPTERS file
2018-11-15 13:16:41 +00:00
Justin Cormack
59ccb84338 Add incomplete ADOPTERS file
Please add your use cases here. There are many adopters that I know about but have not
documented here, please fill this in.

I divided this into production users, and also linked a selection of open source projects
that I know about here.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-11-15 11:28:50 +00:00
Rolf Neugebauer
0c5adbde54 Merge pull request #3223 from rn/kern-up
Kernel update to 4.18.18/4.14.80/4.9.136/4.4.163
2018-11-13 14:58:57 +00:00
Rolf Neugebauer
9f38b4c9aa Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-13 08:30:12 +00:00
Rolf Neugebauer
cc544d1cf2 kernel: Update to 4.18.18/4.14.80/4.9.136/4.4.163
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-12 21:49:34 +00:00
Justin Cormack
14233c2322 Merge pull request #3222 from rn/kup
Update kernel to 4.19.1/4.18.17/4.14.79
2018-11-10 14:55:03 +00:00
Rolf Neugebauer
e746d3e2c7 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-10 12:18:57 +00:00
Rolf Neugebauer
3c5062ff9b kernel: Update to 4.19.1/4.18.17/4.14.79
Also fix the boolean expression for 'perf' in the Dockerfile.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-10 10:26:22 +00:00
Rolf Neugebauer
077e31c10a kernel: Remove unused config files
A previosu commit removed suppoer for 4.18.x kernels for
arm64 and s390x but did not remove the config files. Fix it.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-09 22:51:22 +00:00
Justin Cormack
77d7debd40 Merge pull request #3218 from rn/2018-oct
October 2018 development report
2018-11-02 08:43:53 -07:00
Rolf Neugebauer
58f94915d9 October 2018 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-11-02 00:22:30 +00:00
Ian Campbell
292dbdf46f Merge pull request #3212 from ijc/containerd-v1.2.0
containerd v1.2.0
2018-10-30 15:05:31 +00:00
Ian Campbell
ab8524d3d1 Bump yml to pickup containerd v1.2.0
Also pick a newer version of runc.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-30 11:08:50 +00:00
Ian Campbell
ce126caf3a Bump runc to version from containerd v1.2.0
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-30 10:53:47 +00:00
Ian Campbell
1292f7aa87 Bump packages to new alpine w/ containerd v1.2.0
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-30 10:53:47 +00:00
Ian Campbell
544c8256ea alpine: Bump to containerd v1.2.0
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-30 06:53:32 -04:00
Ian Campbell
a4ca9fa674 getty&ssh: bind /var/lib/containerd
Needed for containerd v1.2.0 otherwise:

    $ ctr run -t docker.io/library/hello-world@sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f test
    [ 1311.667587] overlayfs: failed to resolve '/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/5/fs': -2
    ctr: failed to mount /tmp/containerd-mount111658703: no such file or directory

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-30 09:29:54 +00:00
Ian Campbell
e78b25062c scripts: support credentials helpers on Linux
On Linux a key in `~/.docker/config.json` indicates if a credentials helper is
in use (and which), if one is then the method is identical to the Darwin case
so refactor to support that.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-30 09:29:19 +00:00
Rolf Neugebauer
eac17cc85f Merge pull request #3214 from rn/crosvm
Update crosvm
2018-10-29 23:58:41 +00:00
Rolf Neugebauer
e2f0c496cb contrib/crosvm: Update to the latest crosvm version
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-29 22:37:14 +00:00
Rolf Neugebauer
19826fe96a contrib/crosvm: Update rust to 1.30
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-29 22:30:28 +00:00
Rolf Neugebauer
3f35a7e594 contrib/crosvm: Fix crosvm README
Fix the 'linuxkit build' invocation and remove the duplicated
'minimal.yml' file.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-29 22:30:21 +00:00
Rolf Neugebauer
09420e89f1 Merge pull request #3213 from rn/build-improv
build: Don't create empty kernel/cmdline files
2018-10-29 22:27:24 +00:00
Rolf Neugebauer
1ec59f9aeb build: Don't create empty kernel/cmdline files
If the YAML does not specify a kernel, kernel commandline
or any containers, don't create empty files. Note, an
initrd file is still created if the kernel image contains
CPU ucode.

This only applies to kernel+initrd and tar-kernel-initrd
output formats.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-29 21:03:47 +00:00
Rolf Neugebauer
ddb0fa509e Merge pull request #3211 from rn/kern19
Add 4.19 kernels (and remove 4.18 for arm64 and s390x)
2018-10-29 18:46:16 +00:00
Rolf Neugebauer
26b692d815 tests: Add 4.19 tests
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-29 00:24:27 +00:00
Rolf Neugebauer
e90c9a0687 kernel: perf only for LTS and latest stable/disable for arm64
The logic for perf became too complex. Just build for latest LTS
and latest stable.

Disable for arm64 for now as it is broken for 4.19 due to a header
mismatch:

In file included from /linux/tools/arch/arm64/include/uapi/asm/unistd.h:20:0,
                 from libbpf.c:36:
/linux/tools/include/uapi/asm-generic/unistd.h:754:0: error: "__NR_fcntl" redefined [-Werror]

In file included from /usr/include/sys/syscall.h:4:0,
                 from /linux/tools/perf/perf-sys.h:7,
                 from libbpf.c:35:
/usr/include/bits/syscall.h:26:0: note: this is the location of the previous definition

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-28 21:46:14 +00:00
Rolf Neugebauer
1467a70b44 kernel: Compile bcc for 4.19 instead of 4.18 (x86_64 only)
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-27 12:37:51 +01:00
Rolf Neugebauer
936d47fd2f kernel: Remove 4.18.x for arm64 and s390x
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-27 12:37:16 +01:00
Rolf Neugebauer
2d483ca898 kernel: Add support for the 4.19 kernel
The kernel configs were constructed by running the 4.18.x config
through the 4.19 oldconfig process.

The 4.19.x has a new option, RANDOM_TRUST_CPU, which indicates
if the CPUs random instruction is to be trusted. It defaults to
"no" and this default was accepted.

Most of the defaults were accepted, except for:
BLK_CGROUP_IOLATENCY=y
NFT_TUNNEL=y
NFT_OSF=y
NFT_TPROXY=y
NETFILTER_XT_MATCH_SOCKET=y
NET_VENDOR_CADENCE=n
NET_VENDOR_NETERION=n
NET_VENDOR_PACKET_ENGINES=n

We also disallow CIFS for insecure legacy servers:
CIFS_ALLOW_INSECURE_LEGACY=n

For arm64, the following changes were made to the default:
SENSORS_RASPBERRYPI_HWMON=y
CRYPTO_DEV_QCOM_RNG=m
CRYPTO_DEV_HISI_SEC=m

For s390x, the additional changes were made to the default:
KERNEL_BZIP2 (default is gzip)
GCC_PLUGINS=y
GCC_PLUGIN_STRUCTLEAK=y
GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
GCC_PLUGIN_RANDSTRUCT=y
GCC_PLUGIN_RANDSTRUCT_PERFORMANCE=y

Running the 4.18 and 4.19 kernel config through
./scripts/kconfig-split.py yields the following 4.19.x
only config options for x86_64:

The x86_64 kernel difference to 4.18 for

CONFIG_ARCH_SUPPORTS_ACPI=y
CONFIG_BLK_CGROUP_IOLATENCY=y
CONFIG_BNXT_HWMON=y
CONFIG_BUILD_SALT=""
CONFIG_CONSOLE_LOGLEVEL_QUIET=4
CONFIG_CRASH_CORE=y
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_MEMCG_KMEM=y
CONFIG_MLX5_EN_ARFS=y
CONFIG_MLX5_EN_RXNFC=y
CONFIG_NETFILTER_NETLINK_OSF=y
CONFIG_NETFILTER_XT_MATCH_SOCKET=y
CONFIG_NFT_OSF=y
CONFIG_NFT_TPROXY=y
CONFIG_NFT_TUNNEL=y
CONFIG_NF_SOCKET_IPV4=y
CONFIG_NF_SOCKET_IPV6=y
CONFIG_XEN_SCRUB_PAGES_DEFAULT=y

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-27 12:23:52 +01:00
Rolf Neugebauer
899c242430 Merge pull request #3210 from rn/kern-up
Kernel update to 4.18.16/4.14.78/4.9.135/4.4.162
2018-10-21 14:54:10 -07:00
Rolf Neugebauer
6cf141011c Update YAMLs to the latest kernel
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-21 18:51:09 +01:00
Rolf Neugebauer
35a72cc63c kernel: Update to 4.18.16/4.14.78/4.9.135/4.4.162
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-21 13:04:44 +01:00
Rolf Neugebauer
6b7b64fb08 kernel: Update to 4.18.15/4.14.77/4.9.134/4.4.161
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-20 14:16:28 +01:00
Rolf Neugebauer
40d223b654 kernel: Update to 4.18.14/4.14.76/4.9.133/4.4.160
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-20 11:40:30 +01:00
Rolf Neugebauer
4ed9e4f0d3 kernel: Adjust 4.18.x kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-20 01:27:15 +01:00
Rolf Neugebauer
2f9528f278 Merge pull request #3208 from justincormack/authorsup
Update Authors
2018-10-19 17:25:39 -07:00
Rolf Neugebauer
564a2e85d0 kernel: Update to 4.18.13/4.14.75/4.9.132
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-20 01:08:53 +01:00
Rolf Neugebauer
5b2bdd3ef7 kernel: Print unified diff if kernel config does not match
After 'make oldconfig' we check that that the kernel config
is as we expect and error if they don't. We used to print
the default 'diff' output on a mismatch but a unified diff
is easier to read.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-20 01:05:05 +01:00
Justin Cormack
d3dfdedb0b Update Authors
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-10-19 16:42:53 +01:00
Rolf Neugebauer
73dd7b219d Merge pull request #3206 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20181018
2018-10-18 00:02:44 -07:00
Jason A. Donenfeld
bbb459c2ad wireguard: upgrade to 0.0.20181018
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-18 03:48:12 +02:00
Alice Frosi
8dd28e8e92 Add missing s390x in the switch for qemu Dockerfile
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-10-17 17:41:58 +02:00
Justin Cormack
31e7201413 Merge pull request #3199 from zimbatm/patch-1
README: add the LinuxKit Nix project
2018-10-16 16:01:27 +01:00
Justin Cormack
b7119b2ca5 Merge pull request #3202 from ebriand/gcp-validate-project-name
GCP: validate project name
2018-10-16 14:53:06 +01:00
Eric Briand
4fb5ecd066 gcp: output error message when client could not be created
Signed-off-by: Eric Briand <eric.briand@gmail.com>
2018-10-16 11:57:30 +02:00
Eric Briand
0c6a059f71 gcp: check if bucket exists after client creation
Signed-off-by: Eric Briand <eric.briand@gmail.com>
2018-10-16 11:57:30 +02:00
Eric Briand
b15d0963f4 gcp: validate if project name is filled
Signed-off-by: Eric Briand <eric.briand@gmail.com>
2018-10-16 11:57:30 +02:00
zimbatm
720cfbe249 README: add the LinuxKit Nix project
Signed-off-by: zimbatm <zimbatm@zimbatm.com>
2018-10-16 10:53:30 +02:00
Rolf Neugebauer
34b1b2207f Merge pull request #3198 from TiejunChina/master-dev
update -rt
2018-10-15 22:29:46 -07:00
Tiejun Chen
59cf2ceea6 update -rt to 4.14.71-rt44
Signed-off-by: Tiejun Chen <tiejunc@vmware.com>
2018-10-15 12:57:29 -07:00
Rolf Neugebauer
40905a2117 Merge pull request #3203 from justincormack/lint
Fix golint on circleci and GCP testing
2018-10-15 12:31:54 -07:00
Justin Cormack
50dd28899f Sleep in GCP test
It seems we exit before we connect to the serial console.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-10-15 18:03:17 +01:00
Justin Cormack
78005d87ec Fix golint on circleci
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-10-15 13:53:42 +01:00
Rolf Neugebauer
2e710766e3 Merge pull request #3194 from rn/kup
Kernel update to 4.18.12/4.14.74/4.9.131
2018-10-08 02:46:55 +01:00
Rolf Neugebauer
f268754257 Merge pull request #3196 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20181006
2018-10-06 10:41:17 +01:00
Jason A. Donenfeld
49e6aed4fb wireguard: upgrade to 0.0.20181006
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-06 05:07:57 +02:00
Rolf Neugebauer
116acb9de2 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-06 01:11:13 +01:00
Rolf Neugebauer
1854a59e9f kernel: Update to 4.18.12/4.14.74/4.9.131
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-04 21:07:47 +01:00
Rolf Neugebauer
893bc8fea2 Merge pull request #3193 from rn/kern-up
Kernel update to 4.18.11/4.14.73/4.9.130/4.4.159
2018-10-02 08:03:40 +01:00
Rolf Neugebauer
841026d311 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-01 22:50:46 +01:00
Rolf Neugebauer
d026556652 Merge pull request #3192 from rn/rep-09-2018
September 2018 development report
2018-10-01 21:46:24 +01:00
Rolf Neugebauer
6c9f15522e September 2018 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-01 19:18:03 +01:00
Rolf Neugebauer
7b1c1b1818 kernel: Update to 4.18.11/4.14.73/4.9.130/4.4.159
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-10-01 19:03:09 +01:00
Rolf Neugebauer
5a6fb46b6e Merge pull request #3191 from rn/kup
Kernel update to 4.18.10/4.14.72/4.9.129/4.4.158
2018-09-28 20:29:35 +03:00
Rolf Neugebauer
6bed1aa330 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-28 08:15:08 +01:00
Rolf Neugebauer
617154e2a4 kernel: Update to 4.18.10/4.14.72/4.9.129/4.4.158
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-27 19:42:54 +01:00
Rolf Neugebauer
f5cf0bd054 kernel: Update build to latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-27 19:38:33 +01:00
Justin Cormack
77b6cf0b50 Merge pull request #3190 from ijc/containerd-v1.1.4
Containerd v1.1.4
2018-09-25 09:48:36 -07:00
Ian Campbell
c60cef7be2 Bump yml to pickup containerd v1.1.4
Also pick a newer version of runc.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-09-25 16:28:56 +01:00
Ian Campbell
2ddce9bdea Bump runc to version from containerd v1.1.4
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-09-25 15:55:08 +01:00
Ian Campbell
809d257502 Bump packages to new alpine w/ containerd v1.1.4
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-09-25 15:55:07 +01:00
Ian Campbell
2ad451867e alpine: Bump to containerd v1.1.4
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-09-25 10:54:53 -04:00
Justin Cormack
d7da083c5e Merge pull request #3189 from rn/kern-up
Update kernels to 4.18.9/4.14.71/4.9.128/4.4.157
2018-09-22 16:55:05 +01:00
Rolf Neugebauer
8f8d8e3beb Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-21 21:48:32 +01:00
Rolf Neugebauer
9c1277787b kernel: Update to 4.18.9/4.14.71/4.9.128/4.4.157
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-20 21:19:31 +01:00
Rolf Neugebauer
ae0ddb2053 Merge pull request #3187 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180918
2018-09-18 20:36:00 +03:00
Jason A. Donenfeld
10c3de3ded wireguard: upgrade to 0.0.20180918
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-18 16:56:10 +02:00
Rolf Neugebauer
51a476c8aa Merge pull request #3186 from rn/kup
Update kernels to 4.18.8/4.14.70/4.9.127/4.4.156
2018-09-16 20:27:20 +03:00
Rolf Neugebauer
e61a1a7078 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-16 13:21:12 +01:00
Rolf Neugebauer
a6f7d40d07 kernel: Update to 4.18.8/4.14.70/4.9.127/4.4.156
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-15 19:40:16 +01:00
Rolf Neugebauer
8d7586b867 kernel: Adjust arm64 kernel config
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-15 16:45:14 +01:00
Rolf Neugebauer
c33c14d810 kernel: Update to 4.18.7/4.14.69/4.9.126/4.4.155
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-15 16:02:40 +01:00
Rolf Neugebauer
a503f8c3f3 Merge pull request #3185 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180910
2018-09-11 05:23:18 +01:00
Jason A. Donenfeld
8be1a84dee wireguard: upgrade to 0.0.20180910
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-10 18:59:29 -06:00
Rolf Neugebauer
0532b2889a Merge pull request #3184 from mat007/fix-windows
Fix path separator on Windows
2018-09-10 22:26:43 +01:00
Mathieu Champlon
54868329e6 Fix path separator on Windows
On Windows os.PathSeparator is \ but here it's all unix file paths being manipulated.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-09-10 21:53:09 +02:00
Justin Cormack
576eab21c1 Merge pull request #3183 from mat007/fix-windows
Fix relative path under Windows
2018-09-10 15:17:49 +01:00
Mathieu Champlon
e17b603be8 Fix relative path under Windows
Using filepath primitives instead of manipulating file paths manually takes care of platform specific formats.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-09-10 14:41:43 +02:00
Rolf Neugebauer
816ef159d5 Merge pull request #3182 from rn/lern-up
Update kernels to 4.18.6/4.14.68/4.9.125/4.4.154
2018-09-07 22:16:18 +01:00
Rolf Neugebauer
98961e962c Update YAMLs to latest kernel
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-06 07:47:15 +01:00
Rolf Neugebauer
2743d53a7c kernel: Adjust x86_64 kernel config for 4.18.x and 4.14.x
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-06 07:47:15 +01:00
Rolf Neugebauer
4c725f0318 kernel: Cherry pick multicast fixes into 4.9.x
This cherry picks:
- b6fe0440c637 ("bridge: implement missing ndo_uninit()")
- b1b9d366028f ("bridge: move bridge multicast cleanup to ndo_uninit")

The fix is in b1b9d366028f ("bridge: move bridge multicast cleanup
to ndo_uninit") but it requires b6fe0440c637 ("bridge: implement missing
ndo_uninit()"). Furthermore, b1b9d366028f needed some manual resolution
of a cherry-pick conflict because the surrounding code had changed.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-06 07:47:15 +01:00
Rolf Neugebauer
0a9361d769 kernel: Update to 4.18.6/4.14.68/4.9.125/4.4.154
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-05 21:23:15 +01:00
Rolf Neugebauer
32bc34d168 Merge pull request #3177 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180904
2018-09-05 01:32:09 +02:00
Jason A. Donenfeld
e446af1659 wireguard: upgrade to 0.0.20180904
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-04 12:34:05 -06:00
Rolf Neugebauer
c8449ba2db Merge pull request #3175 from rn/kmisc
EOL 4.17.x, update to 4.4.153, fix BCC build
2018-09-04 00:16:14 +02:00
Justin Cormack
07470f43b8 Merge pull request #3176 from rn/2018-aug-report
Add August 2018 development report
2018-09-03 22:48:53 +01:00
Rolf Neugebauer
fc8079bf98 Add August 2018 development report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-03 21:43:12 +01:00
Rolf Neugebauer
a83e4ca5ba Update YAMLs to linuxkit/kernel:4.4.153
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-03 21:26:42 +01:00
Rolf Neugebauer
763deafd03 kernel: Update to 4.4.153
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-03 20:52:56 +01:00
Rolf Neugebauer
973c62a7f8 tests: Remove 4.17.x kernel tests
4.17 has been EOLed

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-03 20:52:56 +01:00
Rolf Neugebauer
4f29de94ad kernel: Remove 4.17.x. It has been EOLed
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-03 20:52:50 +01:00
Rolf Neugebauer
287c579934 kernel: Compile bcc for 4.18 not 4.17
We want to compile BCC for the latest LTS and the latest
stable and missed the update to 4.18 when enabling it. Do
it now.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-09-03 20:52:50 +01:00
Rolf Neugebauer
66f85ffeba Merge pull request #3170 from rn/kup
Update kernels up to 4.18.5/4,17.19/4.14.67/4.9.124/4.4.152
2018-09-03 21:40:28 +02:00
duraki
1a23054800 Enables CAN networking subsystem (introduced Linux 2.6.25 2008-04-17), to
support SPI in container environment (introduced Linux 4.12 2017-06-02).

Abstraction define interface EP for CAN module in containered environment. This
namespace is available and introduced with Linux Kernel 4.12 by M.  Kicherer
and later O. Hartkopp, to allow containers bridging such device.

@see linux-kernel/net/can@fc4c581

Although KSPP did not explicilty noted `CAN` as secure kernel flag, this
would aim to bring such conclusion. As for security concerns, CAN protocol did
not yield any user-land or host-level vulnerabilities since introduced as
SocketCAN module in Linux Kernel. Lower-layer [protocol] standards is not
secured by default since applications are supposed to implement their own
security mechanism.

This global abstraction currently supports CAN raw, proc and af_can
codes. Does not support GW and BCM. Namespace uses _NEWNET on pseudo-file
system.  Allows modprobe to environment, works by recv `pnet` for the given
interface.

Signed-off-by: Halis Duraki <duraki@linuxmail.org>
2018-08-31 13:22:19 +02:00
Rolf Neugebauer
262e6ed3ec Merge pull request #3171 from ijc/containerd-v1.1.3
Containerd v1.1.3
2018-08-30 20:13:47 +02:00
Ian Campbell
610bfd3e11 Bump yml to pickup containerd v1.1.3
Also pick a newer version of runc.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 13:58:12 +01:00
Ian Campbell
e1c6ae1678 Bump runc to version from containerd v1.1.3
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 13:40:00 +01:00
Ian Campbell
ad556eab78 Bump packages to new alpine w/ containerd v1.1.3
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 13:40:00 +01:00
Ian Campbell
f7c93dc4eb alpine: Bump to containerd v1.1.3
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 08:39:46 -04:00
Rolf Neugebauer
97ef9fb47c Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-28 22:31:46 +01:00
Rolf Neugebauer
323043fdd8 kernel: Update to 4.18.5/4.17.19/4.14.67/4.9.124/4.4.152
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-28 07:24:36 +01:00
Rolf Neugebauer
77b3496d9f kernel: Update to 4.18.4/4.17.18/4.14.66/4.9.123/4.4.151
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-27 21:45:04 +01:00
Rolf Neugebauer
d66c2c6f45 kernel: Update to 4.18.3/4.17.17/4.14.65/4.9.122/4.4.150
Note, this update skips 4.18.2/4.17.16/4.14.64/4.9.121/4.4.149
as the change was a single patch, a bug fix.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-27 18:38:42 +01:00
Rolf Neugebauer
621f88f47e Merge pull request #3169 from TiejunChina/master-dev
update -rt to 4.14.63-rt40
2018-08-27 18:29:52 +02:00
Rolf Neugebauer
89063f4ec5 Merge pull request #3160 from kmjohansen/topics/container-perf
Improve docker container startup times on 4.14, 4.17, and 4.18
2018-08-27 18:28:46 +02:00
Tiejun Chen
a302b2dfa2 update -rt to 4.14.63-rt40
Signed-off-by: Tiejun Chen <tiejunc@vmware.com>
2018-08-26 17:07:40 -07:00
Rolf Neugebauer
0278d74e41 Merge pull request #3166 from l0rd/fix-docker-for-mac-sample
Update docker for mac sample to use iso-efi format
2018-08-23 11:19:51 +02:00
Mario Loriedo
5b1852cfcb Update docker for mac sample to use iso-efi format
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2018-08-22 13:54:22 +02:00
Rolf Neugebauer
0560fa409f Merge pull request #3164 from l0rd/fix-typo
Fix typo in examples/docker-for-mac.md
2018-08-21 12:11:57 +02:00
Krister Johansen
1095c2721d Convert slow net subsystems to modules on 4.14.
In setup_net() there are a few particularly slow subsystems that
contribute more than 140ms of time to the new net namespace creation
path.  The docker daemon doesn't depend on these, and won't modprobe
them into the kernel.  Convert these to modules to reduce the amount of
time it takes for docker to start a container.  This change takes an
additional ~120 ms of time off container start time.

Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-20 17:45:54 -07:00
Krister Johansen
fac99683a7 Switch kernel hz to 1000.
While investigating performance problems around 'docker run' times, it
was observed that a large amount of time was spent in network namespace
creation.  Of that time, a large portion involved waiting for RCU grace
periods to elapse.  Increasing HZ causes the periodic timer to check for
quiesced periods more frequently, which consequently reduces the amount
of time RCU callers spend waiting for grace periods and in barrier
waits.

By itself, this change took the amount of time to execute a 'docker run
hello-world' down to 570ms from over 2000ms on 4.14, and down to 390ms
from 1260 on 4.17 and 4.18.

Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-20 17:45:03 -07:00
Rolf Neugebauer
38766bf2b9 Merge pull request #3163 from rn/kernel-up
Update kernels, Intel ucode and add 4.18.x kernels
2018-08-20 17:32:42 +01:00
Mario Loriedo
62c46e10f2 Fix typo in examples/docker-for-mac.md
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2018-08-20 18:29:09 +02:00
Rolf Neugebauer
6a4d5c970d tests: Update YAMLs to latest kernel config package
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-18 15:47:28 +01:00
Rolf Neugebauer
d003df7b91 tests/kernel-config: Adjust STACKPROTECTOR check for 4.18
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-18 15:42:38 +01:00
Rolf Neugebauer
c6a5439c67 tests: Update bcc test
This updates the package to versions which actually exist
on hub but does not enable the test.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-18 10:56:38 +01:00
Rolf Neugebauer
ab48e4d5e4 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 21:17:04 +01:00
Rolf Neugebauer
64f7e544df tests: Add 4.18.x kernel module test
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 21:13:25 +01:00
Rolf Neugebauer
509e07e63e tests: Add 4.18.x kernel config test
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 21:11:54 +01:00
Rolf Neugebauer
4977514c99 tests: Compact kernel tests
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 21:10:46 +01:00
Rolf Neugebauer
bcd87f6f33 kernel: Remove 4.17.x kernel for s390x and arm64
4.17 will be EOLed soon anyway so save some cycles
compiling kernels on the "slower" arches.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 21:07:08 +01:00
Rolf Neugebauer
dfa6076900 kernel: Add support for 4.18.x kernels
The kernel config was derived from the 4.17.x kernel config
and then tweaked a little. Specifically:
- Enable XDP_SOCKETS
- Enable NFT_CONNLIMIT
- Enable IP_VS_MH
- Enable BPFILTER (as module)

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 16:57:36 +01:00
Rolf Neugebauer
a3bca0ea59 kernel: Add more packages to Dockerfile.kconfig
These packages are needed to enable the GCC_PLUGINS
during 'make oldconfig' for 4.18.x kernels.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 16:57:36 +01:00
Rolf Neugebauer
f93fa6ba9b kernel: Adjust 4.9 kernel config (x86 only)
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 16:57:36 +01:00
Rolf Neugebauer
85369b936f kernel: Adjust 4.14. kernel config (x86 only)
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 16:57:36 +01:00
Rolf Neugebauer
c0fc7b3b01 kernel: Adjust 4.17 kernel config (x86 only)
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 16:57:36 +01:00
Avi Deitcher
a9da8c624d Merge pull request #3162 from deitch/update-compose
Update and fix compose project
2018-08-17 15:19:38 +03:00
Rolf Neugebauer
a1380fcd1c kernel: Update to 4.17.15/4.14.63/4.9.120/4.4.148
The 4.14.63 contains important security fixes in particular
against L1TF (CVE-2018-3615, CVE-2018-3620, CVE-2018-3646) and
userspace-userspace SpectreRSB.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 12:11:04 +01:00
Rolf Neugebauer
5011c473ca kernel: Update Intel microcode to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 11:58:42 +01:00
Avi Deitcher
219e9ec727 Fix static where it tries to delete read-only containers
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2018-08-17 13:33:35 +03:00
Rolf Neugebauer
4792fa5015 kernel: Tidy up Dockerfile.bcc
Use less layers and group it a little better. There should
be no real code change here.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-17 11:18:38 +01:00
Rolf Neugebauer
c0aecf8f26 Merge pull request #3101 from kmjohansen/topics/ebpf
Enable building of bcc in kernel build
2018-08-16 14:57:43 +02:00
Krister Johansen
6e48041dee Add a test case for bcc to packages.
Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-13 17:18:56 -07:00
Krister Johansen
0643093f6a Remove ebpf from projects
Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-13 17:18:56 -07:00
Krister Johansen
a6ac644703 Add some documentation.
Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-13 17:18:55 -07:00
Krister Johansen
188595fcb5 Pull bcc into kernel build.
Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-13 17:18:55 -07:00
Krister Johansen
194fef33cf Get bcc project building again.
Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-08-13 11:28:44 -07:00
Rolf Neugebauer
50904b9f9d Merge pull request #3150 from djs55/revendor-virtsock
Update the vendoring of virtsock
2018-08-13 17:46:00 +02:00
David Scott
4f389eb5a6 Update yamls following virtsock revendor
linuxkit/vsudd:98e554e4f3024c318e42c1f6876b541b654acd9f
linuxkit/host-timesync-daemon:613dc55e67470ec375335a1958650c3711dc4aa6
linuxkit/test-virtsock:57883002c2bc824709efa6cd3818e1ff51a11889
linuxkit/test-ns:a21f996641f391d467a7842e85088a304d24fae5

Signed-off-by: David Scott <dave.scott@docker.com>
2018-08-13 14:16:47 +01:00
Rolf Neugebauer
972c41c4fa Merge pull request #3158 from rn/dock-up
Update all uses of DinD to 18.06.0-ce
2018-08-12 23:18:16 +02:00
Rolf Neugebauer
ff02f6eaa8 Merge pull request #3157 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180809
2018-08-12 12:40:09 +02:00
Rolf Neugebauer
0cb45e0dff doc: Update release doc with DinD uses which should get updated
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-12 10:50:20 +01:00
Rolf Neugebauer
e392ccce5c tests: Update docker bench to 18.0.6-ce
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-12 10:42:37 +01:00
Rolf Neugebauer
971c7fb251 examples: Update all DinD uses to 18.06.0-ce
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-12 10:42:03 +01:00
Jason A. Donenfeld
d987c058bd wireguard: upgrade to 0.0.20180809
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-08-12 01:27:53 -07:00
Rolf Neugebauer
086aa356e7 Merge pull request #3156 from rn/july-report
July 2018 report
2018-08-11 18:51:43 +02:00
Rolf Neugebauer
2eefd6db67 Merge pull request #3155 from rn/kups
Update kernels up to 4.17.14/414/62/4.9.119/4.4.147
2018-08-11 18:51:29 +02:00
Rolf Neugebauer
11d95b61d8 July 2018 report
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-11 11:56:06 +01:00
Rolf Neugebauer
468cbef99d Update YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-11 11:09:47 +01:00
Rolf Neugebauer
394b07da4a kernel: Update to 4.17.14/4.14.62/4.9.119/4.4.147
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-11 09:36:23 +01:00
Rolf Neugebauer
ac48c843e0 kernel: Update to 4.17.13/4.14.61/4.9.118/4.4.146
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-11 00:23:50 +01:00
Rolf Neugebauer
2e32902c98 kernel: Update to 4.17.12/4.14.60/4.9.117/4.4.145
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-10 23:20:43 +01:00
Rolf Neugebauer
9ac0a9a6e3 kernel: Update to 4.17.11/4.14.59/4.9.116
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-08-10 14:26:16 +01:00
Rolf Neugebauer
bdae7d72f7 Merge pull request #3149 from TiejunChina/master-dev
update -rt to 4.14.59-rt37
2018-08-07 16:37:35 +01:00
Rolf Neugebauer
9945d5f6b7 Merge pull request #3151 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180802
2018-08-07 16:36:38 +01:00
Jason A. Donenfeld
7a74c0a212 wireguard: upgrade to 0.0.20180802
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-08-03 22:12:29 +02:00
David Scott
1aae3e309b pkg/virtsock: update vendording of linuxkit/virtsock
Signed-off-by: David Scott <dave.scott@docker.com>
2018-08-02 16:09:35 +01:00
David Scott
5d44a0a33d pkg/ns: update vendoring of virtsock
Signed-off-by: David Scott <dave.scott@docker.com>
2018-08-02 16:09:35 +01:00
David Scott
24a6112548 pkg/host-timesync-daemon: update vendoring of linuxkit/virtsock
Signed-off-by: David Scott <dave.scott@docker.com>
2018-08-02 16:09:29 +01:00
David Scott
50199d5bd5 pkg/vsudd: update the vendoring of linuxkit/virtsock
In addition to bug fixes, this removes the special protocol used
for `shutdown` needed by old Windows builds < 14393.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-08-02 16:09:24 +01:00
Justin Cormack
ccf7ac8081 Merge pull request #3148 from masterzen/fix/3140-vbox-multiple-disks
Enhance `run vbox` to support multiple disks and network adapters
2018-08-02 11:26:02 +01:00
Brice Figureau
02e5f70589 Allow to specify more than one networking adapter for vbox
Note: this patch introduces an incompatibility in the
`linuxkit run vbox` arguments.

It wasn't impossible to specify more than one network adapter
to the `linuxkit run vbox` command.

This patch allows to specify more than one `-networking` argument to specify
different network adapters.

For instance:
~~~sh
linuxkit run vbox -networking type=nat -networking type=hostonly,adapter=vboxnet0
~~~
will setup the VM with 2 NICs.

It is also possible to get rid of the `type` argument.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-08-02 10:34:26 +02:00
Tiejun Chen
b8928d6c56 update -rt to 4.14.59-rt37
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2018-08-01 21:19:37 -07:00
Brice Figureau
f1f128c6dd Allow linuxkit run vbox to use multiple drives
VirtualBox hardware (like physical hardware) has only a limited number
of IDE device on an IDE Controller.
Unfortunately when using an additional drive, it was given the port
value of 2, which doesn't exists in VirtualBox IDE controllers (as
only 0 and 1 are permitted).

This change makes use of the SATA Controller which can host much
more drives, to hook the additional drives.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-07-31 18:27:54 +02:00
Justin Cormack
4968390a92 Merge pull request #3141 from masterzen/fix/3091-enforce-PAX-for-all-files
Fix #3091 enforce all outgoing tar files to use PAX
2018-07-29 11:35:48 -07:00
Brice Figureau
7a7f5f66c2 Fix #3091 enforce all outgoing tar files to use PAX
While processing the content of a tar image, linuxkit's moby tool is
blindly reusing the original tar format.

Moreover it locates the files under a new prefix, so if the original
file was stored as USTAR in the original archive, the filename length
and new prefix could be greater than the USTAR name limit leading
to a fatal error.

The fix is to always enforce PAX format on all copied files from the
original image archive.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2018-07-29 11:03:44 +02:00
Rolf Neugebauer
deb627e56b Merge pull request #3143 from rn/symlink-fix
cmd/pkg: Fix symlink handling in pkg build context
2018-07-27 20:23:52 +01:00
Rolf Neugebauer
23555494fe cmd/pkg: Fix symlink handling in pkg build context
When building the build context, symlink need special
treatment as the link name needs to be added when
building the tar.FileInfoHeader. This code does that.

We may also need to add a special case for hard links
as the moby/moby package 'archive' does, but this
should for now
fixes #3142

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-27 18:39:08 +01:00
Rolf Neugebauer
26ae9a0246 Merge pull request #3139 from rn/post_v0.6
Update version to v0.6+
2018-07-27 01:37:27 +01:00
Rolf Neugebauer
434ee1dffd Update version to v0.6+
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-27 00:06:06 +01:00
Rolf Neugebauer
10f07ca162 Merge pull request #3138 from rn/rel_v0.6
Release prep for v0.6
2018-07-27 00:03:32 +01:00
Rolf Neugebauer
483e7fd111 Update CHANGELOG
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 21:10:37 +01:00
Rolf Neugebauer
9edd8b232b Bump version to v0.6
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 21:02:29 +01:00
Rolf Neugebauer
8f841600a4 doc: Add updating AUTHORS to release steps
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 21:01:59 +01:00
Rolf Neugebauer
bb7961344d Update my email in AUTHORS and MAINTAINERS
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 21:00:24 +01:00
Rolf Neugebauer
d5d4d6fe0d Update package tags to v0.6
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 20:57:30 +01:00
Rolf Neugebauer
3084225180 example: Update docker DIND to 18.06.0
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 20:06:45 +01:00
Rolf Neugebauer
21ff90c4c7 pkgs: Update packages to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 20:03:09 +01:00
Rolf Neugebauer
6fcd0e8429 tests: Update tests cases to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 20:02:29 +01:00
Rolf Neugebauer
27bb10a14c Update use of test packages to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 20:02:12 +01:00
Rolf Neugebauer
2b1428b3d6 tests: Update packages to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 19:49:40 +01:00
Rolf Neugebauer
169e97fe52 Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 19:49:18 +01:00
Rolf Neugebauer
768593b951 tools: Update to the latest linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-26 19:22:42 +01:00
Rolf Neugebauer
ca53674154 tools/alpine: Update to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-26 14:20:05 -04:00
Rolf Neugebauer
bfa8be505b Merge pull request #3136 from rn/sources
Allow external directories for 'linuxkit pkg build'
2018-07-26 18:06:15 +01:00
Rolf Neugebauer
29dd9f2004 doc: Add 'sources' documentation
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-26 16:23:35 +01:00
Rolf Neugebauer
bebde3a2ea cmd/pkg: Build a build context from 'sources'
This is the final piece. If 'sources' are defined, tar up
the sources and rewrite them accordingly. Pass it as build
build context to 'docker'.

This allows building from something like this:

  ├── etc
  │   ├── foo
  └── foo
      ├── Dockerfile
          ├── build.yml
          └── main.go

With 'build.yml':

  image: foo
  extra-sources:
    - ../etc:etc

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-26 16:23:35 +01:00
Rolf Neugebauer
b03288f5b4 cmd/pkg: Add the ability to pass a build context to docker
This commit adds the ability to add a build context to
docker for the package build. The build context is passed
on stdin to the docker process.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-26 16:23:34 +01:00
Rolf Neugebauer
ba4d1c79b0 cmd/pkg: Extract 'extra-sources' and adjust hash calculation
If the build.yml specifies 'extra-sources', ie sources
outside the package directory, calculate the hash based on
the tree hash of all source directories and the package
directory.

Note, this requires the source directories to be under
git revision control.

Also clean up the src and dst of the path and stash the
result in the Pkg structure.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-26 16:23:34 +01:00
Rolf Neugebauer
75149c56c2 cmd/pkg: Add 'extra-source' field to the pkg schema
And 'sources' to the Pkg structure

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-26 14:27:54 +01:00
Rolf Neugebauer
ce6b15c0b6 Merge pull request #3137 from rn/kup
Kernel update to 4.17.10/4.14.58/4.9.115/4.4.144
2018-07-26 07:51:36 +01:00
Rolf Neugebauer
0c631d104f Update YAMLs to latest kernels.
Looks like I missed a few 4.4.x updates to the YAMLs.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-25 23:02:39 +01:00
Rolf Neugebauer
21fb4db99b kernel: Update to 4.17.10/4.14.58/4.9.115/4.4.144
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-25 21:09:25 +01:00
Rolf Neugebauer
d2b8f5291d Merge pull request #3135 from rn/kernel-iso
Add kernel+iso output
2018-07-25 13:14:19 +01:00
Rolf Neugebauer
cad4248024 tests: Fix summary for build format tests
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-25 11:41:36 +01:00
Rolf Neugebauer
b0212e7023 tests: Test kernel+iso format
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-25 11:41:32 +01:00
Rolf Neugebauer
69d913c5a7 cmd: Add 'kernel+iso' output format
This output format create a kernel + and straight data ISO.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-25 11:34:36 +01:00
Rolf Neugebauer
594ce1251d tools: Add a mkimage variant to build a non-bootable ISO.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-25 11:25:59 +01:00
Rolf Neugebauer
1f9b598b1c Merge pull request #3134 from rn/tools-fix
Fix mkimage- builds
2018-07-24 23:57:17 +01:00
Rolf Neugebauer
66b7417819 cmd: Update mkimage-* hashes
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
a9552aee2d tools: Fix mkimage-squashfs
Us a scratch image as the base instead of the alpine
base image.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
fe569b627a tools: Fix mkimage-raw-efi
Use a scratch image as the base instead of the full
alpine base.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
24d8ecc943 tools: Fix mkimage-raw-bios
Build the final image from scratch instead of the full
alpine base image.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
99e65ef998 tools: Fix mkimage-qcow2-efi
Build the final image from scratch instead of the full
alpine base.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
47bff24b94 tools: Fix mkimage-iso-efi
Build the final image from SCRATCH instead of the alpine base.
Should be a lot smaller now.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
4ca0458526 tools: Use a multi-stage build for mkimage-iso-bios
mkimage-iso-bios contained the full alpine base. Only
copy packages actually needed.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-24 22:30:53 +01:00
Rolf Neugebauer
d04a42868f Merge pull request #3132 from rn/kernel-up
Update kernels to 4.17.8/4.17.9/4.14.57/4.9.114/4.4.142/4.4.143
2018-07-24 19:15:23 +01:00
Rolf Neugebauer
c2a083118e Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-24 16:25:52 +01:00
Rolf Neugebauer
6bfba4e85c kernel: Adjust arm64 kernel config to upstream changes
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-24 13:13:42 +01:00
Rolf Neugebauer
480a8bc860 kernel: Update to 4.17.9/4.14.57/4.9.114/4.4.143
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-24 11:56:25 +01:00
Rolf Neugebauer
5ab7eaac89 kernel: Update to 4.17.8/4.4.142
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-24 10:26:37 +01:00
Rolf Neugebauer
8dcddf6be4 Merge pull request #3126 from djs55/logwrite-extension
memlogd/logwrite: use the same naming convention as init
2018-07-20 20:08:44 +01:00
David Scott
d6e7fb9549 Update yaml to linuxkit/memlogd:ba4fcf55c35a3833546a1e39125bf0fa940327b0
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-20 17:06:15 +01:00
Rolf Neugebauer
eede8a5dc7 Merge pull request #3125 from rn/auth
Enable 'linuxkit build' with private repositories and registries
2018-07-20 16:47:26 +01:00
David Scott
ddee5f27f3 memlogd/logwrite: use the same naming convention as init
In e8786d73bb the logwrite package will
automatically append .log to every log.

In 5201049f2c the init package will send
stderr of a service `s` to a log named `s` and the stdout to `s.out`.
Therefore the files we create on disk are `s.log` and `s.out.log`.

This patch modifies the memlogd `logwrite` command-line wrapper to use
the same convention.

Note there is a confusing name clash between `pkg/logwrite` and `cmd/logwrite`
in `memlogd` modified here.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-20 15:31:29 +01:00
Rolf Neugebauer
5dcb3d48cb docs: Update documentation regarding private repos
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-20 14:35:45 +01:00
Rolf Neugebauer
04c061fb8c docs: Remove note on private images
It no longer applies.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-20 13:48:27 +01:00
Rolf Neugebauer
615b122767 cmd: Add support for private repositories and registries
This commit adds support for authentication for image pulls for
'linuxkit build'. For each image reference we look up credentials
via the docker CLI configuration and use it if defined for
a given registry server. The code caches credentials to avoid
lookups for every image.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-20 13:48:26 +01:00
Rolf Neugebauer
1679668121 cmd: Vendor 'github.com/docker/cli' and its deps
This vendors the bits from 'github.com/docker/cli' needed
to pull private images.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-20 13:48:26 +01:00
Rolf Neugebauer
e410070401 cmd: Use "context" instead of "x/net/context"
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-20 13:11:20 +01:00
Rolf Neugebauer
c4f8af23ff cmd: Update vendoring to for docker/docker and dependencies
A subsequent commit will enable support for private repositories.
This requires some functions from 'github.com/docker/cli' which
in turn relies on some newer versions of some of the vendored
packages here.

In this commit, update all packages used here to the versions
used by 'github.com/docker/cli' release 18.06 (the latest stable).

This requires vendoring a bunch of additional packages, such
as prometheus

Also run 'sort' over 'vendor.conf' to keep things in order.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-20 13:11:20 +01:00
Rolf Neugebauer
5d7c1b215a Merge pull request #3124 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180718
2018-07-19 08:13:41 +01:00
Jason A. Donenfeld
f8b14ba25a wireguard: upgrade to 0.0.20180718
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-19 00:00:08 +02:00
Rolf Neugebauer
3520778dcf Merge pull request #3122 from rn/kup
Kernel update to 4.17.7/4.14.56/4.9.113/4.4.141
2018-07-17 18:59:06 +01:00
Rolf Neugebauer
3a03177791 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-17 16:57:50 +01:00
Rolf Neugebauer
1896951b04 kernel: Tweak config for x86
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-17 15:00:23 +01:00
Rolf Neugebauer
f70fc83b1d kernel: Update to 4.17.7/4.14.56/4.9.113/4.4.141
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-17 13:48:18 +01:00
Rolf Neugebauer
aa37cf250f Merge pull request #3121 from rn/authors
Update AUTHORS
2018-07-17 13:20:15 +01:00
Rolf Neugebauer
9b0173a183 Update AUTHORS
We had a few contributors to `moby/tool`. Since this is merged here
update AUTHORS list.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-17 11:51:17 +01:00
Rolf Neugebauer
090f461e7f Merge pull request #3117 from steeve/patch-1
Change GCP metadata SSH keys URL
2018-07-16 20:40:59 +01:00
Rolf Neugebauer
358f1a812a Merge pull request #3115 from justincormack/merge-moby-tool
Merge moby tool back into LinuxKit
2018-07-16 17:52:37 +01:00
Steeve Morin
0748457296 examples: Update linux/metadata:721562e6f3ba9b6c003f9e746ff7ee94796f5251
Signed-off-by: Steeve Morin <steeve.morin@gmail.com>
2018-07-16 18:50:01 +02:00
Justin Cormack
cf5cec204d Update LinuxKit for merge of moby tool
- use the mkimage hashes that we had in LinuxKit as more up to date than tool.
- update docs
- move the code from moby under src/cmd/linuxkit

Signed-off-by: Justin Cormack <justin@specialbusservice.com>
2018-07-16 14:22:15 +01:00
Ian Campbell
5fd9470215 Merge pull request #3119 from ijc/containerd-v1.1.2
Containerd v1.1.2
2018-07-16 12:40:57 +01:00
Ian Campbell
1dfe16e570 Bump yml to pickup containerd v1.1.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-16 10:57:37 +01:00
Ian Campbell
eb48b1284c Bump packages to new alpine w/ containerd v1.1.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-16 10:29:41 +01:00
Ian Campbell
6b6596f881 alpine: Bump to containerd v1.1.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-16 05:29:27 -04:00
Steeve Morin
33b6fc77ea Change GCP metadata SSH keys URL
According to [1] the URL is not sshKeys but ssh-keys now.

[1] https://cloud.google.com/compute/docs/storing-retrieving-metadata

Signed-off-by: Steeve Morin <steeve.morin@gmail.com>
2018-07-15 01:29:31 +02:00
Rolf Neugebauer
d05c9c0af6 Merge pull request #3116 from rn/kernel-up
Update kernels to 4.17.6/4.14.55/4.9.112/4.4.140 + test fixes
2018-07-14 21:42:31 +01:00
Rolf Neugebauer
68cacfe871 tests: Fix the kernel in some tests
These must have fallen through the crack during various
kernel updates. Move everything to the latest 4.14.x kernel.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-14 14:47:52 +01:00
Rolf Neugebauer
e3369b11a6 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-14 14:45:55 +01:00
Rolf Neugebauer
c9dc3b97de kernel: Update to 4.17.6/4.14.55/4.9.112/4.4.140
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-14 13:10:03 +01:00
Justin Cormack
021b5718f8 Merge moby/tool into LinuxKit
Note these ended up with unrelated histories in the export process.

Signed-off-by: Justin Cormack <justin@specialbusservice.com>
2018-07-14 11:26:02 +01:00
Justin Cormack
b807994372 Remove all the parts we do not need when merged back into LinuxKit
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-07-14 10:44:21 +01:00
Rolf Neugebauer
3e4a5342b2 Merge pull request #3113 from rn/test-fix
Update linuxkit/alpine for test cases
2018-07-13 21:35:46 +01:00
Rolf Neugebauer
6b6c93d9d8 Merge pull request #3114 from djs55/kmsg.stderr
Write stderr to /var/log/<name>.log
2018-07-13 13:45:54 +01:00
David Scott
887810a773 Update yml to linuxkit/kmsg:cf3dc833591838596427aac032c829ea592599d0
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-13 11:48:16 +01:00
David Scott
637b1bdb3f pkg/kmsg: write to stderr (instead of stdout)
Part of #3111

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-13 11:48:16 +01:00
David Scott
70385eb86e Update yml to linuxkit/init:3f1e5c32d6ca9e83a7ea7ad9854da2032971a83f
Signed-off-by: David Scott <dave@recoil.org>
2018-07-13 11:48:16 +01:00
David Scott
7c243a8e8b pkg/init: only create /var/log/onboot symlink if not using memlogd
When logging directly to files (the not-using-memlogd case) the onboot
services must log to /run/log because /var/log might be overmounted
by a persistent disk. Therefore we create a symlink at the end of
the onboot section.

When logging via memlogd, all logs are buffered until a logwrite service
starts, so no symlink is needed.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-13 11:47:43 +01:00
David Scott
5201049f2c pkg/init: write stderr to <name> rather than <name>.err
This will then be written to disk as <name>.log by logwrite.

Part of #3111

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-13 10:48:31 +01:00
Justin Cormack
72e919f4b3 Merge pull request #3112 from rn/bcc-pkg
Add packages needed for iovisor/bcc
2018-07-12 11:06:35 +01:00
Rolf Neugebauer
59e04612b4 docs: Add update of test cases to release doc
While at it also improve the commit messages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-12 10:38:32 +01:00
Rolf Neugebauer
1ebc8c0099 tests: Update linuxkit/alpine for tests as well.
I missed this during the recent updates.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-12 10:34:12 +01:00
Rolf Neugebauer
3beb03c684 tools/alpine: Update linuxkit/alpine
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-11 23:59:20 +00:00
Rolf Neugebauer
7d9457382c tools/alpine: Add packages needed for the iovisor/bcc tools
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-12 00:25:30 +01:00
Rolf Neugebauer
ecd412d087 Merge pull request #3109 from rn/log
Add '.log' as file extension to 'pkg/logwrite' files
2018-07-11 22:03:35 +01:00
Rolf Neugebauer
71b5dc8010 Update YAMLs to new logwrite package
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-11 19:17:01 +01:00
Rolf Neugebauer
83f3c58c50 examples: Use alpine:3.8 in logging example
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-11 15:55:28 +01:00
Rolf Neugebauer
d92ca6d6e4 tests: Adjust logging test to new .log extension
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-11 15:55:28 +01:00
Rolf Neugebauer
e8786d73bb pkg/logwrite: Append .log to the log files
Also simplify the code by directly storing the path to
the log file in the LogFile structure.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-11 15:55:27 +01:00
Rolf Neugebauer
90765efac5 Merge pull request #3107 from rn/typo
Fix typo in CHANGELOG
2018-07-11 13:27:23 +01:00
Rolf Neugebauer
77eafc5d6d Fix typo in CHANGELOG
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-11 10:26:02 +01:00
Rolf Neugebauer
fa3bbe3867 Merge pull request #3105 from rn/post_rev0.5
Bump version to v0.5+
2018-07-11 10:21:21 +01:00
Rolf Neugebauer
095bacc396 Bump version to v0.5+
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-11 00:00:10 +01:00
Rolf Neugebauer
811ba12cb0 Merge pull request #3104 from rn/rel_v0.5
Preparation for v0.5 release
2018-07-10 23:58:09 +01:00
Rolf Neugebauer
3181a8f182 Update Authors
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-10 18:46:57 +01:00
Rolf Neugebauer
3ab5e19b2f Update CHANGELOG
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-10 18:44:37 +01:00
Rolf Neugebauer
88afbcae15 build: Bump version to v0.5
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-10 18:32:57 +01:00
Rolf Neugebauer
ea9b29bd19 Update package tags to v0.5
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 18:16:02 +01:00
Rolf Neugebauer
b4c3f9db1f pkg/tss: Switch SF repository to our mirror hosted on github
sourceforge git access is not very reliable...

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 18:00:00 +01:00
Rolf Neugebauer
5b4059fcfd docs: Update release documentation
Add notes to update various external packages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 16:53:49 +01:00
Rolf Neugebauer
4debffafa4 examples/docker: Update to 18.05.0-ce-dind
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 16:53:49 +01:00
Rolf Neugebauer
3672843dc9 pkg/node_exporter: Update to 0.16.0
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 16:53:49 +01:00
Rolf Neugebauer
1a6b6b2db9 pkg/firmware,firmware-all: Update to latest version
Update the the firmware packages to the latest commit
of the upstream linux-firmware repository.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 16:53:49 +01:00
Rolf Neugebauer
46184e258b pkg/cadvisor: Update to 0.30.2
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 16:53:49 +01:00
Rolf Neugebauer
c1e10002b0 pkgs: Update packages to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 15:49:20 +01:00
Rolf Neugebauer
1b22e1e2be Update use of test packages to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 15:37:09 +01:00
Rolf Neugebauer
ccc6e48f38 tests: Update packages to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 15:14:12 +01:00
Rolf Neugebauer
a0a4ec5449 Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 15:13:58 +01:00
Rolf Neugebauer
cd4d50920a tools: Update to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 14:59:45 +01:00
Rolf Neugebauer
4eddd90ae2 Merge pull request #3103 from rn/kup
Update kernel to 4.17.5/4.14.54
2018-07-10 14:21:06 +01:00
Rolf Neugebauer
4ee42d63b9 Merge pull request #3102 from ijc/containerd-v1.1.1
Containerd v1.1.1
2018-07-10 13:05:11 +01:00
Rolf Neugebauer
a90d4a92d5 Update YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 13:03:09 +01:00
Rolf Neugebauer
6a7b336ade kernel: Update to 4.17.5/4.14.54
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 10:58:18 +01:00
Ian Campbell
ec2dfa6625 Revert "tests: Temporarily disable containerd test"
This reverts commit 177008fe0c. The underlying
issue was fixed in containerd v1.1.1.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 10:46:42 +01:00
Ian Campbell
93496067ea Bump yml to pickup containerd v1.1.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 10:19:14 +01:00
Ian Campbell
18f11b2834 Bump packages to new alpine w/ containerd v1.1.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 09:53:11 +01:00
Ian Campbell
8ad9f65ec8 alpine: Bump to containerd v1.1.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 04:52:57 -04:00
Rolf Neugebauer
20bd54c6b0 Merge pull request #3095 from djs55/more-logging
Support log rotation and logging of /dev/kmsg
2018-07-09 22:34:43 +01:00
David Scott
facadbf548 examples/logging: add kmsg to read /dev/kmsg
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
9344473ba5 pkg/kmsg: add simple test case
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
e7fc5b59a3 pkg/kmsg: re-run vndr
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
793dd1b257 Add pkg/kmsg
This very simple program reads from `/dev/kmsg` and logs the output.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
565f787bb3 Add pkg/logwrite which writes and rotates log files
This process connects to memlogd and streams logs to individual files,
one per log. It keeps track of how many bytes have been written to each
file and rotates when the file size exceeds a defined threshold.

By default the maximum size of each file before rotation is 1MiB and
we keep up to 10 files per log.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:51 +01:00
Rolf Neugebauer
4b4d56913d Merge pull request #3100 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180708
2018-07-09 08:39:50 +01:00
Jason A. Donenfeld
05753e7341 wireguard: upgrade to 0.0.20180708
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-08 19:43:03 +02:00
Rolf Neugebauer
b305db0ae5 Merge pull request #3098 from rn/alpine3.8
Update to Alpine 3.8
2018-07-07 23:54:07 +01:00
Rolf Neugebauer
177008fe0c tests: Temporarily disable containerd test
Looks like brtfs-prog v4.17 as shipped with alpine:3.8 requires
a loopback device of 109MB while the containerd tests only
create a 100MB device. This causes the test to fail.

Disable it until https://github.com/containerd/containerd/issues/2447
is fixed.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 21:59:40 +01:00
Rolf Neugebauer
8301540809 Update remaining uses of alpine:3.7 to alpine:3.8
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 19:26:58 +01:00
Rolf Neugebauer
63ae346152 Update YAMLs to latest pkg versions
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 19:25:21 +01:00
Rolf Neugebauer
6045ddaf51 pkg: Use alpine 3.8 version of go (no need for go1.10)
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 18:24:56 +01:00
Rolf Neugebauer
a9acdd827e pkg: Update packages to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 18:05:29 +01:00
Rolf Neugebauer
d7d995cab5 kernel: Update build to use updated alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 17:51:08 +01:00
Rolf Neugebauer
21f65528d2 Update use of test packages to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 17:50:34 +01:00
Rolf Neugebauer
38636e80d9 tests: Use go (not go1.10) for containerd test
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 14:05:42 +01:00
Rolf Neugebauer
c6c502c631 tests: Update packages to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 14:03:01 +01:00
Rolf Neugebauer
5c8df3837d Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 14:00:07 +01:00
Rolf Neugebauer
48ca3f1302 tools: Update to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 13:27:48 +01:00
Rolf Neugebauer
20e71cf09e tools/alpine: Update alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 08:21:54 -04:00
Rolf Neugebauer
1b23313bb3 tools/alpine: Remove gummiboot for arm64
The package does not exist any more in 3.8 and I can't
see any uses for it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 11:43:06 +01:00
Rolf Neugebauer
53af0ce80c tools/alpine: Remove go1.10
alpine:3.8 comes with go 1.10 as default

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 09:30:51 +01:00
Rolf Neugebauer
3c492fe40a tools/alpine: Update to alpine:3.8
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 09:29:59 +01:00
Rolf Neugebauer
29c3ef0aa0 Merge pull request #3085 from djs55/update-logging
Support pluggable logging systems
2018-07-07 09:21:13 +01:00
David Scott
5d614468a0 Update linuxkit/init and linuxkit/memlogd yamls
Signed-off-by: David Scott <dave@recoil.org>
2018-07-06 21:51:04 +01:00
David Scott
9bbc0ecbee projects/logging: delete the remaining unused bits
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
92a9a64a1b examples: add the example from projects/logging
This simplifies the example by adding a service which writes to the
log every 1s and a getty for introspection.

To see the logs:

  /proc/1/root/usr/bin/logread -F

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
a07ecf60d5 memlogd: use kmsg format for reading the logs
Switch to a more formally-specified `kmsg`-style format for reading
the logs.

- update the spec in docs/logging.md
- check for bad names in pkg/memlogd with unit test

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
fe64f33430 memlogd: add test cases
- check writing to the log does not block
- check the log doesn't expand -- it should be finite
- check that client connections don't buffer arbitrary amounts of
  data if the client is slow

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
6aca715ad8 memlogd: replace an unbounded buffer with bounded channel
Previously we had a per-connection

  bytes.Buffer // to be written to the connection
  sync.Cond    // to allow us to Wait for more data

This had the major disadvantage that the buffer was unbounded and so
a slow client could cause memory exhaustion in the server. This patch
replaces these with a single

  chan *logEntry

which is naturally bounded and supports blocking read. We make write
non-blocking using select i.e. we drop messages rather than allocate
more space.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
3e742018d6 memlogd: use net.Conn rather than *net.UnixConn
There's no need to be so specific about the connection implementation.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:25 +01:00
David Scott
c92af038fb projects/logging: promote pkg/memlogd to a toplevel package
This is an example external logging service which can be enabled by
adding it to the `init` section of the .yml, for example:

    ...
    init:
      - linuxkit/init:35866bb276c264a5f664bfac7456f4b9eeb87a4d
      - linuxkit/runc:v0.4
      - linuxkit/containerd:f2bc1bda1ab18146967fa1a149800aaf14bee81b
      - linuxkit/ca-certificates:v0.4
      - linuxkit/memlogd:cc035e5c9e4011ec1ba97a181a6689fc90965ce9
    onboot:
    ...

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:25 +01:00
David Scott
638c455dd2 docs: document how to use an external logging service
This is an updated version of projects/logging/README.md

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:25 +01:00
David Scott
f4bbce7a6c service: use the logging system with runc
If external logging is enabled, this patch sets the stdout and stderr
of the `runc` invocations to one end of a socketpair and the other end is
sent to the logging service. Otherwise we log to files as before.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:21 +01:00
David Scott
4dc75bc67b service: use the logging system with containerd
An external logging system exists if the socket

  /var/run/linuxkit-external-logging.sock

exists.

If an external logging system is enabled then create FIFOs for
containerd and send the other end of the FIFOs to the logging service.
Otherwise use /var/log files as before.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:48:57 +01:00
David Scott
1795c15276 projects/logging: start memlogd from init.d
Previously memlogd would always run in the foreground. This patch
adds a `-daemonize` option which binds the /var/run sockets, forks
and execs itself and immediately returns. Therefore the program won't
block (important for an init.d script) but guarantees the sockets will
be available for any program started afterwards.

This also removes the alpine base from the memlogd image as `init`
"containers" are treated as simple file overlays.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:50 +01:00
David Scott
6dfd40a639 projects/linuxkit: bind /var/run in the memlogd container
We will place the control sockets in the root /var/run and then share
with all services who need access.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:50 +01:00
David Scott
d09fbe04fb projects/logging: use /var/run for sockets by default
Previously we used /tmp, but /var/run is a better place for these.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:49 +01:00
David Scott
8727bcb4f3 projects/logging: fix govet composite literal error
This fixes the error

net.UnixAddr composite literal uses unkeyed fields

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:49 +01:00
David Scott
6eabfdcb96 projects/logging: add modern build.yml and Dockerfile
Signed-off-by: David Scott <dave@recoil.org>
2018-07-06 21:47:49 +01:00
Rolf Neugebauer
2c8438f64b Merge pull request #3093 from TiejunChina/master-dev
update -rt to 4.14.53-rt34
2018-07-06 11:11:03 +01:00
Tiejun Chen
a1d47ff766 update -rt to 4.14.53-rt34
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2018-07-06 14:02:07 +08:00
Rolf Neugebauer
9088e3f843 Merge pull request #3088 from rn/kernel-up
Update kernel to 4.17.4/4.14.53/4.9.11/4.4.139
2018-07-05 10:15:07 +01:00
Justin Cormack
e1cff3614a Merge pull request #3090 from rn/june-report
June 2018 LinuxKit report
2018-07-05 10:00:06 +01:00
Rolf Neugebauer
977dec7ae2 Merge pull request #216 from justincormack/gnutar2
Use PAX tar format
2018-07-04 16:08:57 +01:00
Rolf Neugebauer
91bed426f1 Merge pull request #3089 from masterzen/fix/3087-faq-and-motd
Some FAQ and motd update
2018-07-04 15:05:54 +01:00
Brice Figureau
9a1d9fb1eb Add FAQ entries to help troubleshoot running containers
Since I struggled to understand and find information about how to
troubleshoot a running linuxkit instance, I propose to add these two
FAQ entries.
The first one explains why it is possible to not see the `containerd` or
`init` outputs at boot in the console.
The second one gives a few `ctr` example to list containers, running
containers or how to open a shell in a given container.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-07-04 13:51:19 +02:00
Rolf Neugebauer
b859e7ab4d June 2018 LinuxKit report
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-04 11:24:25 +01:00
Rolf Neugebauer
498d4f1a91 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-04 10:38:55 +01:00
Brice Figureau
f7ff31382b Make sure motd contains the correct ctr command
The listed namespace wasn't correct, and thus the given `ctr` command
wasn't working.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-07-04 11:32:36 +02:00
Rolf Neugebauer
909a9fac68 Merge pull request #3086 from mat007/fix-windows-build
Fix windows build
2018-07-03 18:19:46 +01:00
Rolf Neugebauer
dcc4a5e799 kernel: Update to 4.17.4/4.14.53/4.9.111/4.4.139
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-03 11:49:36 +01:00
Mathieu Champlon
d3e3df3d73 Append .exe to binaries on Windows
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-07-03 12:03:43 +02:00
Mathieu Champlon
82867aa114 Set proper GOOS for Windows
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-07-03 12:02:35 +02:00
Rolf Neugebauer
9dac66b831 Merge pull request #3078 from justincormack/dhcp-hook-fix
Fix dhcpcd hooks config
2018-06-29 19:02:24 +01:00
Justin Cormack
f6af74b6bf Update hashes
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-29 16:40:52 +01:00
Justin Cormack
157c73cfed Fix dhcpcd hooks config
These were being added to the incorrect directory.

Also move config file to /etc to be more standard.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-29 16:31:44 +01:00
Ian Campbell
380e24391d Merge pull request #3084 from ijc/containerd-v1.1.0-rc.2
Containerd v1.1.0-rc.2
2018-06-29 13:30:04 +01:00
Ian Campbell
ad85828d87 Bump yml to pickup containerd v1.1.0-rc.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-29 10:48:10 +01:00
Ian Campbell
34666cd87d Bump packages to new alpine w/ containerd v1.1.0-rc.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-28 17:35:04 +01:00
Ian Campbell
779a611d6b alpine: Bump to containerd v1.1.0-rc.2
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-28 12:34:50 -04:00
Rolf Neugebauer
b37527c23d Merge pull request #3082 from rn/kup
Update kernels to 4.17.3/4.16.18/4.14.52/4.9.110 and then remove 4.16.x (EOLed)
2018-06-27 16:25:57 +01:00
Rolf Neugebauer
0ee4ab7b7f Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-27 14:52:26 +01:00
Rolf Neugebauer
f7cf178ead kernel: Remove 4.16.x as it is EOLed
The previous commit updated to 4.16.18, which is the last
4.16.x kernel. The 4.16.18 kernel was compiled and pushed
but we may as well now remove it as it has been EOLed.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-27 14:49:08 +01:00
Rolf Neugebauer
e7a7fe9339 kernels: Update to 4.17.3/4.16.18/4.14.52/4.9.110
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-27 13:10:44 +01:00
Rolf Neugebauer
e5a3b36d38 Merge pull request #3080 from alanraison/3079-apk-architecture
Use apk --print-arch to discover architecture
2018-06-27 13:03:26 +01:00
Alan Raison
412857be96 Use apk --print-arch to discover architecture
When dealing with apk, `uname -m` doesn't always match the architecture
name that apk uses. Instead `apk --print-arch` is used.

Signed-off-by: Alan Raison <alanraison@users.noreply.github.com>
2018-06-26 23:16:20 +01:00
Rolf Neugebauer
ef47cd9c98 Merge pull request #3077 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180625
2018-06-25 23:28:57 +01:00
Jason A. Donenfeld
bfd0ba0983 wireguard: upgrade to 0.0.20180625
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-06-25 19:58:49 +02:00
Rolf Neugebauer
8f962b9e4a Merge pull request #3076 from rn/kernel-up
kernel update to 4.16.17/4.14.51/4.4.137/4.4.138
2018-06-22 17:55:07 +01:00
Rolf Neugebauer
e36eae4820 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-22 16:12:34 +01:00
Justin Cormack
561e9375e8 Merge pull request #3075 from justincormack/binfmt_mount
Binfmt fixes
2018-06-22 16:09:34 +01:00
Justin Cormack
8ac642e4e0 Update yaml files for new package
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-22 14:18:31 +01:00
Justin Barrick
14ba30f418 Workaround DNS issue with qemu-user-static on alpine by using Debian in the first stage #2710
DNS lookups fail in qemu-user when it is built on Alpine: https://bugs.alpinelinux.org/issues/8131

Until this is resolved, we fetch the binaries from Debian and use those instead. The final stage
of the Dockerfile is still based on scratch.

We can revert this once the Alpine issue is fixed.

Signed-off-by: Justin Barrick <jbarrick@cloudflare.com>
2018-06-22 14:10:50 +01:00
Justin Cormack
a6dbe8ceba Rather than bind mounting binfmt_misc filesystem, mount a copy.
For some reason, bind mounting does not always seem to work,
sometimes the filesystem is empty. Mounting a fresh copy seems
a better solution, and simplifies things. The container does
need `CAP_SYS_ADMIN` but only on boot.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-22 14:10:43 +01:00
Rolf Neugebauer
2eec092862 kernel: Adjust kernel configs
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-22 10:01:18 +01:00
Rolf Neugebauer
9f1f99026d kernel: Update to 4.16.17/4.14.51/4.4.138
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-22 10:01:18 +01:00
Rolf Neugebauer
ef5c128a8c kernel: Update to 4.4.137
Somehow I missed this kernel update when it happened...

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-21 16:17:29 +01:00
Rolf Neugebauer
f347ba9412 Merge pull request #3074 from rn/kup
Kernel update to 4.17.2/4.16.16/4.14.50/4.9.109
2018-06-21 08:10:58 +01:00
Rolf Neugebauer
aed5328d2b Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-20 15:36:12 +01:00
Rolf Neugebauer
2ff0491ac1 kernel: Update to 4.17.2/4.16.16/4.14.50/4.9.109
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-20 13:50:23 +01:00
Rolf Neugebauer
268b5269f9 kernel: Update to 4.9.108
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-20 13:19:24 +01:00
Rolf Neugebauer
9817d7eb3c Merge pull request #3073 from ijc/containerd-v1.1.1-rc.1
Containerd v1.1.1-rc.1
2018-06-20 08:17:18 +01:00
Ian Campbell
bb307079b0 Bump yml to pickup containerd v1.1.1-rc.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-19 16:50:56 +01:00
Ian Campbell
90f7d1bed9 Bump packages to new alpine w/ containerd v1.1.1-rc.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-19 16:01:20 +01:00
Ian Campbell
a5ed0cf40a alpine: Bump to containerd v1.1.1-rc.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-19 11:00:45 -04:00
Rolf Neugebauer
fe4c7cdb75 Merge pull request #3070 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180613
2018-06-15 00:12:54 +01:00
Jason A. Donenfeld
8ce01c5736 wireguard: upgrade to 0.0.20180613
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-06-14 18:26:41 +02:00
Rolf Neugebauer
ccfdc71a2f Merge pull request #3068 from rn/kernel-up
Update kernel to 4.17.1/4.16.15/4.14.49
2018-06-14 16:45:05 +01:00
Rolf Neugebauer
b698d26c87 Merge pull request #3018 from Sh4d1/scaleway_provider
Add Scaleway provider to linuxkit
2018-06-14 13:18:49 +01:00
Patrik Cyvoct
f088b05e9a Update examples yaml to use new metadata package
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2018-06-14 12:27:41 +02:00
Patrik Cyvoct
8d5ced3a1d Add documentation for scaleway provider
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2018-06-14 11:51:06 +02:00
Patrik Cyvoct
3c6434e022 Add scaleway yaml examples
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2018-06-14 11:51:05 +02:00
Patrik Cyvoct
a6783261f3 Add Scaleway support for linuxkit command line tool
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2018-06-14 11:51:04 +02:00
Patrik Cyvoct
f8d399490e Add new dependencies
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2018-06-14 11:51:04 +02:00
Patrik Cyvoct
5ab6b88029 Add Scaleway provider in metadata package
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2018-06-14 11:51:03 +02:00
Rolf Neugebauer
3a3b487907 Merge pull request #3069 from justincormack/aws-meta
Add support for aws metadata and security groups in linuxkit run
2018-06-14 08:17:11 +01:00
Justin Cormack
068df79031 Add support for aws metadata and security groups in linuxkit run
- set userdata for AWS
- set security group

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-13 19:07:12 -07:00
Rolf Neugebauer
1ff88a957c Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-13 13:31:27 +01:00
Avi Deitcher
15b5057a8b Merge pull request #3063 from justinbarrick/master
Add a restart and stop command to service.
2018-06-12 16:54:13 -07:00
justinbarrick
338b1bb017 Update init image hashes.
Signed-off-by: justinbarrick <jbarrick@cloudflare.com>
2018-06-12 15:10:54 -07:00
Justin Barrick
9821180548 Add a restart and stop command to service.
Signed-off-by: justinbarrick <jbarrick@cloudflare.com>
2018-06-12 15:04:16 -07:00
Rolf Neugebauer
45f563fc66 kernel: Update to 4.17.1/4.16.15/4.14.49
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-12 17:18:11 +01:00
Rolf Neugebauer
a6f50ff565 Merge pull request #3066 from rn/auth
Update authors
2018-06-11 22:19:38 +01:00
Rolf Neugebauer
e0c411f5ef Update authors
Also add another alias for @ijc

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-06-11 20:14:30 +01:00
Rolf Neugebauer
a4420a789d Merge pull request #3030 from kmjohansen/kmj-reboot
Reboot should reboot instead of powering off.
2018-06-11 19:54:41 +01:00
Krister Johansen
45222dfaaf Move init image to fbcbbe3ace0b3e9455300017dd07625293a0d4d4.
This attempts to work around a CI issue where we're running out of disk
space when rebuilding the init package.

Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-06-11 08:29:20 -07:00
Krister Johansen
16604bc039 Reboot should reboot instead of powering off.
When busybox's reboot processing occurs in init, it runs all SHUTDOWN
actions that are defined in inittab.  Once those are complete, it will
trigger either a halt, poweroff, or reboot, depending upon what signal
is received.  The mechanism that's used to shell out through inittab
does not allow us to pass through exactly which invocation was
requested.

Due to the way that rc.shutdown works, it invokes the poweroff action
for any and all SHUTDOWN callbacks, whether they're a reboot, poweroff,
or halt.  Instead of handling the reboot(2) syscall in rc.shutdown,
return after killing and unmounting and let busybox's init process
decide which reboot(2) action to use.

Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
2018-06-11 08:29:08 -07:00
Justin Cormack
154a5b3ea6 Merge pull request #3065 from rn/wireguard
tests: Fix wireguard test shutdown
2018-06-09 10:27:50 -07:00
Rolf Neugebauer
00c21a652a tests: Fix wireguard test shutdown
With PR #3030 the behaviour of poweroff/halt is changed. This
test relies on on-shutdown containers to be executed to display
the test result (service containers have their stdout redirected).
Use 'poweroff' (note, no '-f') to ensure that:
- the machine actually powers off
- the on-shutdown container is executed

Note, there are subtle differences between 'poweroff' and 'halt'
between hypervisors. With HyperKit, 'halt' actually works, but with
qemu/kvm, with 'halt' the process does not exit.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-06-09 12:47:46 +01:00
Rolf Neugebauer
3195451ec4 Merge pull request #3062 from rn/kern-up
Update kernels to 4.16.14/4.14.48/4.9.10[67]/4.4.136
2018-06-08 21:55:50 +01:00
Rolf Neugebauer
7dbd1a52cd Update YAML files to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-07 15:43:10 +01:00
Rolf Neugebauer
6b629fa30b kernel: Tweak 4.4.x kernel config file
Add new (disabled) option CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-07 13:54:53 +01:00
Rolf Neugebauer
4e830a35a1 kernel: Update to 4.16.14/4.14.48/4.9.107/4.4.136
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-07 12:10:22 +01:00
Rolf Neugebauer
17d9870dd7 kernel: Update to 4.9.106
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-07 11:42:54 +01:00
Rolf Neugebauer
6ad3055401 Merge pull request #3060 from rn/kern-src
Stash kernel source and WireGuard source in the package
2018-06-07 11:29:40 +01:00
Rolf Neugebauer
8a7ba7197e Merge pull request #3061 from justincormack/gcp-userdata
Add support for userdata on GCP plus custom name
2018-06-07 11:29:08 +01:00
Justin Cormack
42397f7f1d Add support for setting different name on GCP
Previously name and image were always the same so running two hosts
from one image was not possible!

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-06 16:22:20 -07:00
Justin Cormack
c9db3f0625 Add support for userdata on GCP
This was missing in the linuxkit CLI, even though we support it in the
metadata package.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-06-06 16:05:51 -07:00
Rolf Neugebauer
18ec668c91 kernel: Consistently use curl -f
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-06 18:32:23 +01:00
Rolf Neugebauer
5176ce7dd3 kernel: Stash kernel source and WireGuard source in the package
While we can re-create the kernel source code we don't have it
handily available in one place. This commit stashes the kernel
and the WireGuard source as /src/linux.tar.xz and
/src/wireguard.tar.xz in the kernel package.

This increases the size of the hub image by around 100MB.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-06 18:32:23 +01:00
Avi Deitcher
414b4c5275 Merge pull request #3059 from deitch/motd-namespace-warning
Add services.linuxkit warning to motd for sshd and getty
2018-06-06 17:16:23 +03:00
Rolf Neugebauer
a0e7417968 Merge pull request #3058 from rn/kup
kernel: Add 4.17, update 4.14.47/4.9.106/4.4.135, remove 4.16.x for arm64/s390x
2018-06-06 14:56:55 +01:00
Avi Deitcher
d85ce30e0e Change image sha tags to match latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2018-06-06 15:52:49 +03:00
Avi Deitcher
643414f6f4 Add services.linuxkit warning to motd for sshd and getty
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2018-06-06 14:32:12 +03:00
Rolf Neugebauer
193c4fa4da Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-06-06 08:26:54 +01:00
Rolf Neugebauer
3792a61ccb test: Add 4.17.x kernel tests
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-06 08:26:54 +01:00
Rolf Neugebauer
fc6bcde1fd kernel: Remove 4.16 for arm64 and s390x
Trying to keep the number of kernels we compile for these
platforms small and 4.16 is likely to be EOLed soon anyway.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-06 08:26:54 +01:00
Rolf Neugebauer
25738c0768 kernel: Add support for 4.17.x kernels
The kernel configs are the 4.16.x configs run through
a 'make defconfig && make oldconfig' cycle.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-06 08:26:54 +01:00
Rolf Neugebauer
ba5e75a24e kernel: Update to 4.14.47/4.9.105/4.4.135
These releases are a single patch only, fixing  a bug.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-06 08:26:54 +01:00
Rolf Neugebauer
25c74cbfe8 Merge pull request #3056 from rn/sntpc
tools/alpine: Add sntpc to alpine base
2018-06-05 15:11:35 +01:00
Rolf Neugebauer
910d453769 tools/alpine: Add sntpc to alpine base
sntpc is a very simple ntpc client, which may be useful
for some setups.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-06-05 08:10:18 -04:00
Rolf Neugebauer
197f438d1e Merge pull request #3055 from rn/may-report
LinuxKit report May 2018
2018-06-03 15:56:01 +01:00
Rolf Neugebauer
b5a00f17ec LinuxKit report May 2018
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-06-03 14:26:17 +01:00
Ian Campbell
a6925908a6 Merge pull request #3054 from ijc/containerd-v1.1.1-rc.0
Bump to containerd v1.1.1-rc.0
2018-06-01 16:12:00 +01:00
Ian Campbell
56f7a8c9f3 Bump yml to pickup containerd v1.1.1-rc.0
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-01 14:24:06 +01:00
Ian Campbell
525ff1c1a8 Bump packages to new alpine w/ containerd v1.1.1-rc.0
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-01 14:09:05 +01:00
Ian Campbell
55d66b434f alpine: Bump to containerd v1.1.1-rc.0
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-01 08:49:28 -04:00
Rolf Neugebauer
dae753cf0a Merge pull request #3053 from ndauten/memorizer-remove-poison
Memorizer: remove kasan poison on boot
2018-06-01 08:14:52 +01:00
Nathan Dautenhahn
3ddca63774 Memorizer: remove kasan poison on boot
Originally, Memorizer kernel fed inputs to add boot printouts from a debug tool, however, it creates unnecessary output. Remove the kernel boot option parameter.

Signed-off-by: Nathan Dautenhahn <ndd@cis.upenn.edu>
2018-05-31 16:49:27 -04:00
Rolf Neugebauer
81c9e9c58f Merge pull request #3051 from rn/test-wg
tests: Use poweroff instead of halt for wireguard test
2018-05-31 15:55:33 +01:00
Rolf Neugebauer
0676bc7592 tests: Use poweroff instead of halt for wireguard test
The proposed change in https://github.com/linuxkit/linuxkit/pull/3030
seems to timeout on the wireguard test. Try 'poweroff -f' instead
of 'halt' to stop the test VM.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-31 14:04:43 +01:00
Rolf Neugebauer
bd59dbf793 Merge pull request #3050 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180531
2018-05-31 07:56:05 +01:00
Jason A. Donenfeld
5e10631fe2 wireguard: upgrade to 0.0.20180531
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-31 02:21:28 +02:00
Rolf Neugebauer
946712460b Merge pull request #3049 from rn/kern-up
Update kernels to 4.16.12/4.16.13/4.14.44/4.14.46/4.9.103/4.9.104/4.4.133/4.4.134
2018-05-30 20:09:15 +01:00
Rolf Neugebauer
932ed11e06 Update YAMLs to latest kernels.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-30 18:34:10 +01:00
Rolf Neugebauer
9e8f458780 kernel: Adjust kernel config for arm64/x86 for 4.14.x and 4.16.x
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-30 16:14:53 +01:00
Rolf Neugebauer
acc059e6c8 kernel: Updatr to 4.16.13/4.14.46/4.9.104/4.4.134
Note, we skip 4.14.45 because 4.14.46 only has 3 patches
in it which unbreak 'perf' compilation.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-30 15:59:03 +01:00
Rolf Neugebauer
8acb257012 kernel: Fix s390x config for 4.16.x
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-30 14:51:45 +01:00
Rolf Neugebauer
d9a1ea45ce kernel: Update to 4.16.12/4.14.44/4.9.103/4.4.133
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-30 14:36:14 +01:00
Rolf Neugebauer
679edce979 Merge pull request #3047 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180524
2018-05-24 15:39:44 +01:00
Rolf Neugebauer
78e974e04f Merge pull request #3048 from rn/kup
Update kernels to 4.16.10/4.16.11/4.14.42/4.14.43/4.9.101/4.9.102
2018-05-24 15:39:29 +01:00
Rolf Neugebauer
697b904803 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-24 14:00:34 +01:00
Jason A. Donenfeld
e945773f63 wireguard: upgrade to 0.0.20180524
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-24 14:45:29 +02:00
Rolf Neugebauer
00ce115df9 kernel: Update to 4.16.11/4.14.43/4.9.102
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-24 13:11:31 +01:00
Rolf Neugebauer
454d2142f3 kernel: Update to 4.16.10/4.14.42/4.9.101
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-24 10:54:45 +01:00
Rolf Neugebauer
8687c79482 Merge pull request #3045 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180519
2018-05-23 16:28:28 +01:00
Avi Deitcher
250604a680 Merge pull request #3046 from mingrammer/readme
Add a missing right parenthesis in README.md
2018-05-22 18:26:50 +03:00
mingrammer
30795173b9 Add a missing right parenthesis
Signed-off-by: mingrammer <mingrammer@gmail.com>
2018-05-22 23:02:03 +09:00
Jason A. Donenfeld
6e04261450 wireguard: upgrade to 0.0.20180519
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-19 03:19:21 +02:00
Justin Cormack
653d9805a9 Merge pull request #3043 from rn/kernup
Kernel update to 4.16.9/4.14.41/4.9.100/4.4.132
2018-05-16 21:08:53 +01:00
Rolf Neugebauer
ec82c4989c Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-05-16 19:44:07 +01:00
Rolf Neugebauer
bc7103d1a3 kernel: Fixup arm64 kernel config for 4.14.41
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-16 18:04:29 +01:00
Rolf Neugebauer
c4a265c77f kernel: Update to 4.16.9/4.14.41/4.9.100/4.4.132
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-05-16 17:55:10 +01:00
Rolf Neugebauer
a326f9e084 Merge pull request #3042 from TiejunChina/master-dev
update -rt to 4.14.40-rt30
2018-05-16 10:36:54 +01:00
Tiejun Chen
ccd9998461 update -rt to 4.14.40-rt30
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2018-05-15 13:46:26 +08:00
Rolf Neugebauer
90fb6316c2 Merge pull request #3041 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180513
2018-05-14 08:11:58 +01:00
Jason A. Donenfeld
49c1f0007c wireguard: upgrade to 0.0.20180513
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-13 21:38:28 +02:00
Rolf Neugebauer
ce9c5eb6fb Merge pull request #3040 from TiejunChina/master-dev
update -rt to 4.14.39-rt29
2018-05-12 21:00:17 +01:00
Rolf Neugebauer
21cb73257b Merge pull request #3039 from rn/docs
docs: Add document on how to do releases
2018-05-12 18:53:16 +01:00
Justin Cormack
2d034db7f8 Merge pull request #3038 from rn/post_relv0.4
Bump version to v0.4+
2018-05-12 18:19:13 +01:00
Rolf Neugebauer
9af0179d1b docs: Add document on how to do releases
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-05-12 17:14:47 +01:00
Rolf Neugebauer
e920eea1c4 Bump version to v0.4+
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-05-12 16:55:27 +01:00
Tiejun Chen
ac2e5c53ec update -rt to 4.14.39-rt29
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2018-05-12 23:43:14 +08:00
Justin Cormack
d3a1de393f Use PAX tar format
The default Go tar has restrictions on filename length for example.

PAX is recommended over GNU.

Requires Go 1.10

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-04-24 16:46:26 +01:00
Justin Cormack
3a3a4560a3 Merge pull request #217 from justincormack/go1.10
Move to Go 1.10
2018-04-24 16:42:37 +01:00
Justin Cormack
0eb9076675 Move to Go 1.10
We need the Format exptension in the tar package.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-04-24 16:20:15 +01:00
Justin Cormack
3dbad3b7da Merge pull request #214 from rn/squash
Add  'kernel+squashfs' output format
2018-04-16 14:46:47 +01:00
Rolf Neugebauer
a39cee3f18 initrd: Skip rest of ./boot
For the initrd we only want to extract kernel, cmdline, and
the ucode CPIO archive. Skip whatever is left in ./boot

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-04-16 14:42:14 +01:00
Rolf Neugebauer
ad11be6b83 moby: Add 'kernel+squashfs' output
This output produces a kernel and a root filesystem
in squashfs format. squashfs is a read-only, compressed
filesystem.

The 'kernel+squashfs' output can be used in a similar way as
the default 'kernel+initrd' output format with the benefit
that the rootfs does not consume any memory.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-04-16 14:35:38 +01:00
Rolf Neugebauer
52cb0e1cfe moby: Improve debug output for 'docker run'
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-04-16 14:12:19 +01:00
Rolf Neugebauer
4a569d2815 Merge pull request #213 from rn/mkimage
Add ability to overwrite images used for outputs
2018-04-13 13:56:16 +01:00
Rolf Neugebauer
4cae8c95e3 Add ability to overwrite images used for outputs
We currently hardcode the Linuxkit/mkimage- images. This has the
unfortunate consequence that, if we update the LinuxKit image used
to generate the output, we have to update the Moby tool and then
vendor it back into the LinuxKit repository.

This commit introduces UpdateOutputImages() which allows a client
of the Moby tools package to selectively overwrite the packages
used to generate the outputs.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-04-13 13:50:33 +01:00
Justin Cormack
9534e84ffe Merge pull request #212 from justincormack/notaryup
Update Notary vendor
2018-04-12 11:37:44 +01:00
Justin Cormack
ede65b6445 Update Notary vendor
Bring some other vendoring in line with Notary

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-04-11 11:13:10 +01:00
Rolf Neugebauer
486e313fe3 Merge pull request #211 from rn/update
Update mkimage images based on linuxkit/alpine to latest.
2018-04-05 11:37:59 +01:00
Rolf Neugebauer
f848bc9a3c Update mkimage images based on linuxkit/alpine to latest.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-04-05 11:07:53 +01:00
Justin Cormack
f1ae82c9eb Merge pull request #210 from justincormack/bind-shared
Default bind mounts to rshared not rprivate if not specified
2018-04-04 18:54:44 +01:00
Justin Cormack
25cfac5463 Default bind mounts to rshared not rprivate if not specified
It is quite confusing that from the host or another container that
binds `/containers` you cannot see the bind mounts, you have to enter
the container namespace. I think `rshared` is a better default. You
can always be explicit and add `private` if you want a private bind mount.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-03-26 13:54:49 -07:00
Justin Cormack
749585dd13 Merge pull request #208 from rn/up
Update mkimage packages
2018-03-19 21:23:35 -07:00
Rolf Neugebauer
efeb0ac185 Update mkimage packages
They have been update in linuxkit/linuxkit in prep for
s390x support.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-03-16 09:53:35 +00:00
Justin Cormack
ed49ca3aa0 Merge pull request #207 from nogoegst/fix-dup-string-readme
Reword the README to remove repeating statements
2018-03-12 14:17:34 +00:00
Ivan Markin
47986c53e9 Reword the README to remove repeating statements
Signed-off-by: Ivan Markin <sw@nogoegst.net>
2018-03-11 20:28:52 +00:00
Justin Cormack
c9d52b5787 Merge pull request #206 from justincormack/notaryup
Update notary vendor to 0.6.0
2018-03-01 11:23:24 +00:00
Justin Cormack
8682dd213f Merge pull request #205 from garthy/qcow2-efi-support
Add qcow2 EFI image building support
2018-03-01 11:23:18 +00:00
Justin Cormack
d3919d0a79 Update notary vendor to 0.6.0
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-03-01 11:15:50 +00:00
Garth Bushell
e1b4f769cb Add qcow2 EFI image building support
Signed-off-by: Garth Bushell <garth.bushell@oracle.com>
2018-03-01 11:11:23 +00:00
Justin Cormack
830794f3c0 Merge pull request #204 from deitch/fix-doc-typos
Fix typos
2018-02-16 11:48:36 +00:00
Avi Deitcher
07878aa631 Fix typos
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2018-02-15 21:37:38 +02:00
Justin Cormack
4a0d9e1247 Merge pull request #203 from deitch/docs-for-private-repos
Add documentation about using images from private registries
2018-02-15 13:24:21 +00:00
Avi Deitcher
01ea437bd1 Add documentation about using images from private registries
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2018-02-15 14:43:17 +02:00
Justin Cormack
bd556c86f7 Merge pull request #201 from rn/fix
The vmdk and dynamic-vhd packages had a bug in them
2018-01-25 19:35:07 +00:00
Rolf Neugebauer
8fb1a88757 The vmdk and dynamic-vhd packages had a bug in them
This picks up a newer version

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-25 18:04:07 +00:00
Rolf Neugebauer
7fb28974b6 Merge pull request #200 from rn/up
Update LinuxKit images to the latest
2018-01-25 14:48:36 +00:00
Rolf Neugebauer
5c1ebdbaa2 Update LinuxKit images to the latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-25 14:15:52 +00:00
Justin Cormack
caca03c097 Merge pull request #199 from justincormack/namespace
Add support for setting containerd namespace in runtime config
2018-01-17 14:19:45 +00:00
Justin Cormack
2dd65d27b6 Add support for setting containerd namespace in runtime config
This adds a namespace field to override the LinuxKit containerd
default namespace, in case you want to run a container in another
namespace.

Needs a patch in LinuxKit to implement this that I will open soon.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-01-17 14:12:15 +00:00
Justin Cormack
978deceed0 Merge pull request #198 from justincormack/annotations
Add support for OCI annotations in config
2018-01-17 12:40:31 +00:00
Justin Cormack
929a837d65 Add support for OCI annotations
Annotations do not do anything by default but get passed through to the runtime,
which can be useful. I never metadata I didn't like...

Also fix sysctl to be a map in the validation, not an array. I can't see any
examples using this in LinuxKit, but this matches OCI so is correct.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-01-17 12:26:08 +00:00
Justin Cormack
7918437b72 Make test should be phony
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-01-17 12:02:32 +00:00
Rolf Neugebauer
57b6e2ab94 Merge pull request #197 from rn/ucode
Add support for Intel ucode
2018-01-15 17:00:03 +00:00
Rolf Neugebauer
1d995e198a docs: Document the 'ucode' kernel option.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-15 16:49:43 +00:00
Rolf Neugebauer
5d5a13526b output: Add support for CPU ucode to the kernel+initrd format
This prepends 'ucode.cpio' to the initrd if present. Padding
should not be necessary as the ucode.cpio should be padded
to the right size.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-15 16:49:43 +00:00
Rolf Neugebauer
1d24454438 output: Add ucode.cpio to the tar-kernel-initrd format
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-15 16:49:42 +00:00
Rolf Neugebauer
2b1a611bab output: Extract ucode if present
For now the backends for the different formats do not yet
use the extracted ucode cpio archive, but '// TODO' are
placed for the backends which should eventually handle it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-15 16:49:42 +00:00
Rolf Neugebauer
0c1b1def13 build: Add ucode to the intermediate tar ball if specified
This extends the kernel filter to also look for the CPU microcode
file if specified in the YAML. If found, the ucode cpio archive
is placed into the intermediate tar file as '/boot/ucode.cpio'.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-15 16:49:42 +00:00
Rolf Neugebauer
b4704b8ba1 config: Add 'ucode' to the kernel schema
This optional option will allow users to specify a CPU
microcode cpio archive to be prepended to the initrd file.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-01-15 16:49:42 +00:00
Justin Cormack
f816553d2f Merge pull request #195 from ijc/prepend-rootfs-mounts
Prepend the rootfs mounts to the user specified runtime.mounts.
2018-01-11 12:15:18 +00:00
Ian Campbell
0a6d69d2d3 Prepend the rootfs mounts to the user specified runtime.mounts.
User specified mounts should be able to rely on the rootfs being mounted, in
particular for a writeable container they should expect the writeable overlay
to already be in place.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-01-11 11:42:25 +00:00
Justin Cormack
1aca4eefa5 Merge pull request #190 from ijc/containerd-v1.0.0-rc.0
Bump to containerd v1.0.0
2018-01-04 11:28:10 +00:00
Justin Cormack
b5615a3714 Merge pull request #192 from w9n/fix_empty_container_config
allow ImageInspect.Config to be nil when parsing
2018-01-04 11:27:42 +00:00
Justin Cormack
41d67e3bf3 Merge pull request #194 from w9n/yml_omitempty
add omitempty for yml config
2018-01-04 11:26:54 +00:00
Robin Winkelewski
175fadb3d4 add omitempty for yml config
Signed-off-by: Robin Winkelewski <w9ncontact@gmail.com>
2017-12-27 03:08:44 +01:00
Robin Winkelewski
1b06de3136 fix inspect.Config usage
Signed-off-by: Robin Winkelewski <w9ncontact@gmail.com>
2017-12-14 07:11:17 +01:00
Justin Cormack
d9d2a91780 Merge pull request #193 from ijc/bugfix-191
Defer dockerRm until we are finished with the contents
2017-12-13 09:35:13 -08:00
Ian Campbell
307f13b129 Defer dockerRm until we are finished with the contents
This was introduced by #191 but somehow did not trigger either for me in local
testing or in CI.

It did trigger in initial CI of https://github.com/linuxkit/linuxkit/pull/2811
which can be seen at https://linuxkit.datakit.ci/linuxkit/linuxkit/pr/2811?history=1637690296123e9a15307b3a41b290da6e27e7cc
The error is:

    Failed to docker rm container «...»: «...»: aufs: unmount error after retries: «...»: device or resource busy

No doubt because we were still holding an open fd while trying to remove the
container.

Unclear why this didn't repro for me (docker 17.11.0-ce with overlay2) or
whatever CI uses.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-13 11:44:32 +00:00
Ian Campbell
12629fcb96 Bump to containerd v1.0.0
Since that bumps to gogo protobuf v0.5 too do the same.

Note that there are no actual containerd changes here, although there are some
gogo proto ones.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-13 10:12:42 +00:00
Justin Cormack
ebd7228a44 Merge pull request #191 from ijc/reduce-memory-via-tempfiles
Reduce maximum memory usage via tempfiles
2017-12-12 13:27:32 -08:00
Ian Campbell
3045a80c85 Stream docker export directly to consumer
Rather than queueing up into a `bytes.Buffer`.

In my test case (building kube master image) this reduces Maximum RSS (as
measured by time(1)) compared with the previous patch from 2.8G to 110M. The
tar output case goes from 2.1G to 110M also. Overall allocations are ~715M in
both cases.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-06 16:41:42 +00:00
Ian Campbell
9f44acf8e3 Generate intermediate image into a temp file
All of the `output*` functions took a `[]byte` and immediately wrapped it in a
`bytes.Buffer` to produce an `io.Reader`. Make them take an `io.Reader` instead
and satisfy this further up the call chain by directing `moby.Build` to output
to a temp file instead of another `bytes.Buffer`.

In my test case (building kube master image) this reduces Maximum RSS (as
measured by time(1)) from 6.7G to 2.8G and overall allocations from 9.7G to
5.3G. When building a tar (output to /dev/null) the Maximum RSS fell slightly
from 2.2G to 2.1G. Overall allocations remained stable at around 5.3G.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-06 16:07:46 +00:00
Ian Campbell
9558740c11 Add cpu and mem profiling options
Following https://golang.org/pkg/runtime/pprof/. When attempting to build
images in https://github.com/linuxkit/kubernetes CI the process is mysteriously
being SIGKILL'd, which I think might be down to OOMing due to the resource
limits placed on the build container.

I haven't done so yet but I'm intending to use these options to investigate and
they seem potentially useful in any case, even if this turns out to be a
red-herring.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-06 15:54:48 +00:00
Justin Cormack
656bd87fd2 Merge pull request #189 from ijc/image-config-substruct
Split config-related fields of Image into a substruct.
2017-11-28 11:59:25 +00:00
Ian Campbell
f9893d9a9b Fixup test after Image → ImageConfig split.
The syntax used for the yaml definitions is changed by the need to include the
substruct in the struct literal.

For the label switch to `ImageConfig` directly, which is actually more correct
in that it avoids spurious `name` and `image` fields in the label.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-27 14:47:21 +00:00
Ian Campbell
aec82c4cdf Split config-related fields of Image into a substruct.
Where "config-related" here means "ones you might find in the
"org.mobyproject.config" label on an image.

By making this new struct an anonymous member of the existing Image struct the
Go json parser does the right thing (i.e. inlines into the parent) when parsing
a complete image (from a yml assembly) by default. The Go yaml library which we
use requires a tag on the anonymous field to achieve the same.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-27 14:16:59 +00:00
Justin Cormack
63a5dedd28 Merge pull request #188 from justincormack/make-tmp-dir
Create tmp dir in case required
2017-11-20 16:59:27 +00:00
Justin Cormack
3389f89c44 Create tmp dir in case required
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 16:50:58 +00:00
Justin Cormack
ad2fda5769 Merge pull request #187 from justincormack/build-improvements
Make easier to use as a library
2017-11-20 14:05:25 +00:00
Justin Cormack
6395e339b9 Do not error if cache/config directory not specified
Just use the default. Easier to use as an external library.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 13:52:53 +00:00
Justin Cormack
e3a7739f42 Make easier to embed in LinuxKit
Split out util file in same way.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 12:04:08 +00:00
Justin Cormack
6ba3288963 Merge pull request #186 from gesellix/fix-docker-build-cmd
Fix docker format build example
2017-11-19 10:11:16 +00:00
Tobias Gesellchen
5aebd207d0 Fix docker format build example
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
2017-11-18 22:22:33 +01:00
Justin Cormack
315e5f80e8 Merge pull request #185 from justincormack/fix-make
Stop make test from removing binary
2017-11-17 15:21:08 +00:00
Justin Cormack
f85e019d2e Merge pull request #183 from ijc/static-builds
Build a static binary
2017-11-17 14:43:08 +00:00
Justin Cormack
8f75b635ec Stop make test from removing binary
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-17 14:40:49 +00:00
Ian Campbell
532b41ff8b Disable CGO so as to build a static binary
https://github.com/linuxkit/kubernetes/pull/1#issuecomment-345253075 lead to
https://circleci.com/gh/linuxkit/kubernetes/15

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-17 14:39:19 +00:00
Justin Cormack
eceb6d11f8 Merge pull request #181 from justincormack/runtime-cgroups
Add Cgroups to runtime config
2017-11-17 14:12:08 +00:00
Justin Cormack
c9bb1ecdf1 Add Cgroups to runtime config
This will create the list of cgroups specified

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-17 13:22:38 +00:00
Justin Cormack
91311b9de8 Merge pull request #178 from tristanls/master
Prob: Files section does not work for /var dir
2017-11-16 17:20:33 +00:00
Justin Cormack
7c3e0e87b2 Merge pull request #182 from ijc/circleci-artefacts
Tweak circleci config to try and fix artifact upload
2017-11-16 17:19:58 +00:00
Ian Campbell
c180946fb4 Publish a checksum of the binaries.
Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-16 17:15:06 +00:00
Ian Campbell
fff4f0ce79 Try and put dist artifacts at the top level.
Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-16 17:13:41 +00:00
Ian Campbell
e6bdd72158 Tweak circleci config to try and fix artifact upload
It appears that the `$GOPATH` in `working_directory` is being treated as a literal
`GOPATH` at least when processing the `state_artifacts.path`. Inlining it seems
to have worked, at the cost of some duplication.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-16 17:13:11 +00:00
Tristan Slominski
11c90c4cdb Prob: Files section does not work for /var dir
Solv: Updated documentation to point out limits of
files section regarding /var, /run, and /tmp dirs.

Signed-off-by: Tristan Slominski <tristan.slominski@gmail.com>
2017-11-14 15:08:07 -06:00
Justin Cormack
a14db39956 Merge pull request #180 from ehazlett/poule-config
Initial poule config
2017-11-14 17:20:38 +00:00
Evan Hazlett
36c5bf55ed add initial poule config
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-11-14 12:16:54 -05:00
Justin Cormack
b262aaa058 Merge pull request #177 from arm64b/docker-efi-images
EFI image hash value update
2017-11-14 16:04:34 +00:00
Dennis Chen
90f1582988 EFI image hash value update
Update the hash value of EFI-* docker image

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-11-10 08:10:22 +00:00
Justin Cormack
76035cec2f Merge pull request #176 from justincormack/sirupsen
Update dependencies to use sirupsen not Sirupsen
2017-11-01 15:23:10 +00:00
Justin Cormack
45333d2480 Update dependencies to use sirupsen not Sirupsen
That entailed a few other fixes, eg small Notary API changes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-01 15:14:58 +00:00
Justin Cormack
99480b5dd0 Merge pull request #175 from deitch/fix-prereqs
Fix prereqs in output.go
2017-10-31 10:37:55 +00:00
Avi Deitcher
31187652ce Fix prereqs, raw images with correct calcs
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-10-31 10:51:55 +02:00
Justin Cormack
3b03f76cd4 Merge pull request #174 from justincormack/no-gopath
Add a build target which works when GOPATH is not set or correct
2017-10-30 14:44:08 +00:00
Justin Cormack
a7158e1cb2 Add a build target which works when GOPATH is not set or correct
Getting Homebrew to work with a GOPATH is horrible...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-30 14:39:59 +00:00
Justin Cormack
df201350c0 Merge pull request #172 from justincormack/fix-clean
rm -rf for clean
2017-10-30 13:36:25 +00:00
Justin Cormack
71dfe66ee1 rm -rf for clean
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-30 13:31:33 +00:00
Justin Cormack
a12e954d92 Merge pull request #173 from justincormack/lint-fix
Fix some lint errors with error checking
2017-10-30 13:31:11 +00:00
Justin Cormack
14ed0953cd Fix some lint errors with error checking
This is due to lack of rebase after linter changes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-30 13:25:22 +00:00
Justin Cormack
4a95c04300 Merge pull request #169 from deitch/add-raw-efi-bios-rename-aws
Add raw file formats, rename raw to aws and qcow2 to qcow2-bios
2017-10-30 11:28:53 +00:00
Justin Cormack
626b41fd30 Merge pull request #162 from ebriand/init-processing-logging
Add back init image processing logging
2017-10-30 11:24:53 +00:00
Justin Cormack
4ed9d49d3a Merge pull request #168 from dnephin/improve-the-build
Improvements to Makefile, linting, and circleci.yml
2017-10-30 11:24:24 +00:00
Avi Deitcher
60c1ce5156 Add raw file formats, rename raw to aws and qcow2 to qcow2-bios
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-10-23 20:27:47 -04:00
Justin Cormack
57c6720356 Merge pull request #171 from ijc/pull-before-run
Do an explicit docker pull before docker run.
2017-10-20 17:26:16 +02:00
Ian Campbell
d9d6b56153 Do an explicit docker pull before docker run.
This avoids https://github.com/docker/cli/issues/631

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-10-20 15:51:47 +01:00
Daniel Nephin
ec741857ef Remove unnecessary vendor.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-10-17 17:32:05 -04:00
Daniel Nephin
a224547540 Fix lint errors
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-10-17 17:30:47 -04:00
Daniel Nephin
e009b670f3 Improve makefile and circleci config
Use gometalinter for linting
put build artifact in dist/
store artifacts in circleci

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-10-17 17:30:44 -04:00
Justin Cormack
b23d883ca5 Merge pull request #167 from rn/fix
Fix mkimage-iso-bios hash
2017-10-16 13:59:10 +02:00
Rolf Neugebauer
67ce80d213 Fix mkimage-iso-bios hash
Looks like a6b89f1137 ("Update linuxkit/mkimage-*") updated to a
non-existing tag.

linuxkit pkg show-tag tools/mkimage-iso-bios
linuxkit/mkimage-iso-bios:165b051322578cb0c2a4f16253b20f7d2797a502

and docker pull of that image works.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-16 12:52:02 +02:00
ebriand
0754e4d662 Add back init image processing logging
Signed-off-by: ebriand <eric.briand@gmail.com>
2017-10-16 11:00:19 +02:00
Justin Cormack
2fea21c0d7 Merge pull request #166 from rn/rpi3
output: Add support for creating Raspberry Pi images
2017-10-14 08:33:13 +01:00
Rolf Neugebauer
c1da07b3a8 output: Add support for creating Raspberry Pi images
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-13 18:02:17 +01:00
Justin Cormack
17865a1c3e Merge pull request #160 from nuald/docs
Updated the documentation regarding binds options.
2017-10-13 16:31:39 +01:00
Justin Cormack
f75e4f8291 Merge pull request #164 from ijc/update-mkimage-plus-no-docker-network
Update mkimage plus no docker network
2017-10-13 16:28:22 +01:00
Ian Campbell
52de62206d Ensure moby is rebuilt if deps change.
Signed-off-by: Ian Campbell <ijc@docker.com>
2017-10-13 10:59:55 +01:00
Ian Campbell
a6b89f1137 Update linuxkit/mkimage-*
These versions were created by https://github.com/linuxkit/linuxkit/pull/2607
which enables content trust, so drop the sha256 from all of them and ensure
DOCKER_CONTENT_TRUST is unconditionally set when running, since these
references are hardcoded we know they must be signed.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-10-13 10:56:21 +01:00
Ian Campbell
8825ca2e66 Disable network in dockerRun
AFAICT none of the callers (which all involve one of `linuxkit/mkimage-*`) have
any reason to hit the network.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-10-13 10:42:40 +01:00
Alexander Slesarev
76c36afc60 Updated the documentation regarding binds options.
Signed-off-by: Alexander Slesarev <alex.slesarev@gmail.com>
2017-10-10 08:51:08 +10:00
Justin Cormack
70c6aebd26 Merge pull request #159 from rn/img-ref
Restructure Image and image reference code
2017-10-09 12:29:13 +01:00
Justin Cormack
9abca80507 Merge pull request #158 from justincormack/tar-kernel-initrd
Add a "tar-kernel-initrd" output format
2017-10-09 12:27:11 +01:00
Rolf Neugebauer
1aee0c3d30 Update Image strings before writing them out
If the YAML file contains:
  - path: etc/linuxkit.yml
    metadata: yaml
in the fil section, the image was build with content trust,
then the linuxkit.yml file image contains fully qualified
image references (including the sha256).

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-04 17:59:02 +01:00
Rolf Neugebauer
ad83cb8928 Use containerd reference.Spec in place of the Image string
Instead of passing the image name as string use the a reference
to a containerd reference.Spec. This allows us, for example,
to update the reference in place when verifying content trust
with more specific information, such as the sha256

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-04 17:37:22 +01:00
Rolf Neugebauer
d9b79548a5 Add a containerd reference.Spec for the Image name
When constructing a Moby structure from a YAML also
extract a containerd reference.Spec for each image
and the kernel.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-04 17:26:42 +01:00
Rolf Neugebauer
1713f59e4f Turn Images into references
We want to modify some of the content of the Image structure
and thus have to pass them by reference.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-04 17:26:42 +01:00
Justin Cormack
e73a7b0315 Add a "tar-kernel-initrd" output format
This is a tarball of the kernel, initrd and cmdline files, suitable for
sending to the mkimage images that expect this format.

Note you can't currently stream this output format using `-o` will clean this
up in future commits.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-04 17:01:13 +01:00
Rolf Neugebauer
e8a5728ca3 Vendor containerd
The next commit will start using some components of containerd
so vendor the latest version.

The latest vndr also removed some un-needed files previously vendored.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-10-04 14:17:02 +01:00
Justin Cormack
61ff1e5bba Merge pull request #157 from justincormack/no-hyperkit
Remove the hyperkit option
2017-10-03 15:58:59 +01:00
Justin Cormack
aca26f00c2 Remove the hyperkit option
We are going to phase out the LinuxKit build option, in favour of keeping Docker
or a native Linux build option for CI use cases, as it is faster. So the
hyperkit option that only worked in one very limited use case is not needed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-03 15:55:02 +01:00
Justin Cormack
ccaba8acc1 Merge pull request #156 from justincormack/no-init
Remove unused init package
2017-10-03 14:10:16 +01:00
Justin Cormack
fdee7f3792 Remove unused init package
We now use the same on as linuxkit.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-03 13:42:48 +01:00
Justin Cormack
cc823286f4 Merge pull request #153 from ijc/subassign-runtime
More granular merge of Runtime from labels & yaml
2017-10-02 11:40:14 +01:00
Justin Cormack
177969dc4a Merge pull request #154 from justincormack/iso-efi-update
Update to use new common iso EFI for amd64 and arm64
2017-09-25 11:11:24 -07:00
Justin Cormack
1fc16c4580 Update to use new common iso EFI for amd64 and arm64
See https://github.com/linuxkit/linuxkit/pull/2524

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-09-25 11:02:37 -07:00
Ian Campbell
a5a3b778c0 More granular merge of Runtime from labels & yaml
Previously any Runtime specified in yml would completely override anything from
the image label, even if they set distinct fields. This pushes the merging down
to the next layer, and in the case of BindNS down two layers.

Most of the fields involved needed to become pointers to support this, which
required a smattering of other changes to cope. As well as the local test suite
this has been put through the linuxkit test suite (as of cc200d296a).

I also tested in the scenario which caused me to file #152.

Fixes #152.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-09-22 13:18:36 +01:00
Justin Cormack
63eae8abee Merge pull request #149 from justincormack/shared-init
Used shared init with LinuxKit
2017-09-18 18:10:08 -07:00
Justin Cormack
dff6dc2876 Used shared init with LinuxKit
With https://github.com/linuxkit/linuxkit/pull/2500 the init script
can be used for both bare metal and in Docker.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-09-18 13:11:37 -07:00
Justin Cormack
7ee5ff77d1 Merge pull request #150 from ijc/updates
Couple of minor updates to metadata file output
2017-09-18 13:10:24 -07:00
Ian Campbell
411a21ae07 Make "metadata: yaml" actually output yaml
The existing code made json...

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-09-18 15:13:32 +01:00
Ian Campbell
2f01ab25ed Correct example yaml
Without the space I get:

    FATA[0000] Invalid config: yaml: line 66: could not find expected ':'

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-09-18 15:13:32 +01:00
Justin Cormack
1ff0e3beee Merge pull request #146 from justincormack/formats
Rename "output" to "format"
2017-09-01 23:51:27 +01:00
Justin Cormack
11b573c6fb Rename "output" to "format"
This was confusing as there is an option to output to a file as well.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-09-01 23:45:25 +01:00
Justin Cormack
69596e17dd Merge pull request #145 from justincormack/runtime-mount
Add support for mount in runtime config
2017-08-23 16:44:13 +01:00
Justin Cormack
cfa5d273b7 De-dup container root filesystems
With the mount framework we can de-dup containers that share the same image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-22 17:27:08 +01:00
Justin Cormack
6b98aff58b Use the runtime config to specify how overlay should be created
This puts the build side in charge of the runtime layout, which enables
additional optimisations later, like sharing the rootfs if it is
used multiple times.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-22 16:21:56 +01:00
Justin Cormack
ee0901762f Add support for mount in runtime config
This could be used in LinuxKit now, as there are some examples, eg
https://github.com/linuxkit/linuxkit/blob/master/blueprints/docker-for-mac/base.yml#L33
which are creating containers to do a mount.

The main reason though is to in future change the ad hoc code that generates
overlay mounts for writeable containers with a runtime config which does
the same thing; this code needs to create both tmpfs and overlay mounts.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-22 15:17:54 +01:00
Justin Cormack
0d58d332be Merge pull request #144 from justincormack/runtime-config
Add support for runtime configuration
2017-08-18 15:50:39 +01:00
Justin Cormack
ea60eff557 Add support for runtime configuration
This adds a `runtime` section in the config that can be used
to move network interfaces into a container, create directories,
and bind mount container namespaces into the filesystem.

See also https://github.com/linuxkit/linuxkit/pull/2413

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-17 17:36:49 +01:00
Justin Cormack
d9546ee1ce Merge pull request #143 from justincormack/filepathjoin
Do not use filepath.Join if constructing LinuxKit paths
2017-08-14 17:36:59 +01:00
Justin Cormack
4da3c09e19 Do not use filepath.Join if constructing LinuxKit paths
This will do the wrong thing on Windows, and construct paths with \.

fix #142

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-14 15:38:58 +01:00
Justin Cormack
7a549fda07 Merge pull request #141 from justincormack/update-docker
Update docker examples
2017-08-10 15:05:22 +01:00
Justin Cormack
13b1eb7d0c Do not use rm as may not be in root filesystem
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-10 14:59:32 +01:00
Justin Cormack
2a097f543d update xeamples to new hashes
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-10 14:58:50 +01:00
Justin Cormack
0e65f04ab4 update init for containers for recent changes
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-10 14:57:53 +01:00
Justin Cormack
680fafd705 Merge pull request #140 from justincormack/device-cgroup
Add Cgroup resource limits into Yaml spec
2017-08-10 11:16:41 +01:00
Justin Cormack
13a1ffdd44 Add Cgroup resource limits into Yaml spec
This adds all the cgroup restrictions into the spec.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-09 16:39:10 +01:00
Justin Cormack
c2b081ed8a Merge pull request #137 from justincormack/efi-tar
Output EFI ISO as for BIOS ISO with filesystem on.
2017-08-07 17:45:26 +01:00
Justin Cormack
7b36db8358 Output EFI ISO as for BIOS ISO with filesystem on.
The image is multi-arch and should work on arm64 as it has no boot loader...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-07 16:44:13 +01:00
Justin Cormack
b9de5ff4c6 Merge pull request #135 from justincormack/iso-tar
Use new style ISO BIOS mkimage from Linuxkit which unpacks filesystem
2017-08-02 14:46:50 +01:00
Justin Cormack
2d930bc8e5 Use new style ISO BIOS mkimage from Linuxkit which unpacks filesystem
Rather than using an initrd, unpack full filesystem for ISO BIOS.

Stream docker output direct to file rather than via a buffer, to save
memory.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-02 14:24:24 +01:00
Justin Cormack
305ad031e8 Merge pull request #134 from justincormack/hardlink-path
Fix hardlinks in tar output
2017-08-02 11:34:47 +01:00
Justin Cormack
48e42540d2 Fix hardlinks in tar output
When we converted these to cpio we were not noticing that they
were invalid as they had incorrect paths as we converted the
path to a symlink anyway. Only the busybox images have hard links
in, the Alpine ones are symlinks anyway, which is why it was
less visible too.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-01 17:04:57 +01:00
Justin Cormack
14a4d923ae Merge pull request #132 from justincormack/fix-ro
Fix read only output when defined in a label
2017-07-28 14:40:52 +01:00
Justin Cormack
3dec6855e0 Fix read only output when defined in a label
Also do some code cleanup.

Related to #131 we need to read the OCI config to find if the container
is read only, not rely on the yaml, as it may just be set in the label.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-28 14:34:18 +01:00
Justin Cormack
51005b42c5 Merge pull request #130 from justincormack/update-mkimage
Update mkimage used for building to lastest hashes
2017-07-28 13:57:49 +01:00
Justin Cormack
7010eae061 Update mkimage used for building to lastest hashes
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-28 13:35:59 +01:00
Justin Cormack
b65a8f86bc Merge pull request #129 from justincormack/ro-rw-setup
Rework setup of container for read only/read write
2017-07-28 11:10:53 +01:00
Justin Cormack
e388c0ff14 Rework setup of container for read only/read write
To work with truly immutable filesystems, rather than ones
we sneakily remount `rw`, we are going to use overlay for
writeable containers. To leave the final mount as `rootfs`,
in the writeable case we make a new `lower` path for the read
only filesystem, and leave `rootfs` as a mount point for an
overlay, with the writable layer and workdir mounted as a tmpfs
on `tmp`.

See https://github.com/linuxkit/linuxkit/issues/2288

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-27 14:52:13 +01:00
Justin Cormack
36217e5145 Merge pull request #128 from justincormack/resolvconf-init
In the init section use a symlink for /etc/resolv.conf
2017-07-25 15:39:34 +01:00
Justin Cormack
6403215635 In the init section use a symlink for /etc/resolv.conf
Unfortunately there are a lot of issues with resolv.conf as we
cannot actually write it into the image from any docker image, as docker will
always have something bind mounted in.

In addition, normally we expect the filesystem to br read only for images
that moby generates, so the actual etc/resolv.conf is likely not to be writeable.

Previously we were adding in a default resolv.conf into every image pointing at
Google's name servers but that is really a bad idea.

Instead, normal images now get an empty default, while images in the `init`
section will get a symlink, currently hard coded to `/run/resolvconf/resolv.conf`
but you can override this with the `files` section to be static or a different
link.

In future, if we have an easy way to build and extract images with user control
of this, we can drop this.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-25 14:40:40 +01:00
Justin Cormack
2c4d567781 Merge pull request #125 from justincormack/tmpdir
Add a tmp directory for each container to be used as a mount point
2017-07-24 17:19:32 +01:00
Justin Cormack
8e720bff08 Merge pull request #126 from ijc/containerd-alpha1-update
Containerd alpha1 update
2017-07-20 13:28:51 +01:00
Ian Campbell
feba1d7d98 Bump to image-spec v1.0.0 and runtime-spec v1.0.0
No substantive changes.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-20 12:23:09 +01:00
Ian Campbell
e8d5005b0e Synchronise vendoring with containerd v1.0.0-alpha1
Some of these are arbitrary and just syncing for the sake of it, however the
image- and runtime-spec are relevant. Interesting changes:

- runtime spec:
  - LinuxRLimit is now POSIXRLimit.
  - Specs.Config is now a pointer.
  - LinuxResources.DisableOOMKiller moved to
    LinuxResources.LinuxMemory.DisableOOMKiller
- image spec:
  - Platform.Features is removed (unused here).

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-20 12:03:22 +01:00
Ian Campbell
dec42921d7 Rerun vndr with latest version
This removes some files which are marked `// +build ignore`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-20 12:03:22 +01:00
Justin Cormack
4720490c92 Add a tmp directory for each container to be used as a mount point
This is to clean up how we do writeable containers in LinuxKit.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-19 11:29:03 +01:00
Justin Cormack
a261a33812 Merge pull request #124 from justincormack/onshutdown
Add support for onshutdown
2017-07-18 14:17:53 +01:00
Justin Cormack
6eb74b2f2b Add support for onshutdown
This is a list of images to run on a clean shutdown. Note that you must not rely on these
being run at all, as machines may be be powered off or shut down without having time to run
these scripts. If you add anything here you should test both in the case where they are
run and when they are not. Most systems are likely to be "crash only" and not have any setup here,
but you can attempt to deregister cleanly from a network service here, rather than relying
on timeouts, for example.

Fix https://github.com/linuxkit/linuxkit/issues/1988

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-18 13:55:52 +01:00
Justin Cormack
43bd663816 Merge pull request #123 from justincormack/json-for-top-level
Add json config for top level config
2017-07-18 13:34:27 +01:00
Justin Cormack
55f7df577a Add json config for top level config
Otherwise JSON output as metadata cannot actually be used as it
has capitalised field names.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-18 13:16:58 +01:00
Justin Cormack
4105b7ea31 Merge pull request #122 from justincormack/metadata
Add a "metadata" file contents flag
2017-07-17 15:56:06 +01:00
Justin Cormack
5a013825dd Add metadata into test image
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-17 15:44:12 +01:00
Justin Cormack
12439d947d Do not modify data structure while building
This will give odd effects if we output the yaml structure into the image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-17 15:42:26 +01:00
Justin Cormack
760521e197 Document metadata in files section
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-17 15:40:07 +01:00
Justin Cormack
040c500648 Add more omitempty to json spec
The metadata config was rather verbose.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-17 15:31:31 +01:00
Justin Cormack
389dd8c0fa Add a "metadata" file contents flag
Currently this supports "yaml" as the only option, which will output
the yaml config (as JSON) into the file specified in the image.

Fix #107

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-17 15:31:24 +01:00
Justin Cormack
f035995b22 Merge pull request #120 from riyazdf/system-pool-fix
trust: do not call x509.SystemCertPool as nil will use this as default
2017-07-14 22:53:24 +01:00
Riyaz Faizullabhoy
c3b2c7d575 trust: do not call x509.SystemCertPool as nil will use this as default
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-07-14 14:39:39 -07:00
Justin Cormack
f255d671c6 Merge pull request #117 from justincormack/uid
Allow uid, gid fields to be numeric or names
2017-07-14 18:05:12 +01:00
Justin Cormack
cc33e67492 Allow uid, gid fields to be numeric or names
Previously I was forcing them to be strings, which is horrible. Now you
can either specify a numeric uid or the name of a service to use the
allocated id for that service.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-14 16:57:12 +01:00
Justin Cormack
a824287800 Merge pull request #116 from justincormack/kernel-options
Allow specifying the kernel and tarball names, or omitting tarball
2017-07-14 14:32:53 +01:00
Justin Cormack
830be373da Allow specifying the kernel and tarball names, or omitting tarball
fix #113

Use `tar: none` or `tar: ""` to omit the tarball.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-14 14:09:42 +01:00
Justin Cormack
1664445ad6 Merge pull request #115 from justincormack/contrib-move
Move Contributing to top level
2017-07-14 11:55:04 +01:00
Justin Cormack
7bc763a628 Move Contributing to top level
- accidentally committed to wrong directory

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-14 11:50:51 +01:00
Justin Cormack
d12d1f12c0 Merge pull request #114 from dave-tucker/make
Makefile: Update for ease of Homebrew installation
2017-07-14 11:46:26 +01:00
Dave Tucker
5934a24206 Makefile: Update for ease of Homebrew installation
This removes the `lint` dependency from building Moby.
I've also added ineffassign to check ineffecutal assignments alongside
checks to ensure that both it and golint are installed.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2017-07-14 10:03:44 +01:00
Justin Cormack
4db06aa173 Merge pull request #111 from ijc/master
Update LinuxKit components used for build
2017-07-13 14:48:38 +01:00
Ian Campbell
f20828bf7e Update LinuxKit components used for build
This updates to the current set of images as of
https://github.com/linuxkit/linuxkit/pull/2159

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-13 14:43:34 +01:00
Justin Cormack
75cc04a03d Merge pull request #109 from justincormack/contributing
Add Contributing doc
2017-07-12 12:20:14 +01:00
Justin Cormack
b4804b69e8 Add Contributing doc
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-12 12:04:33 +01:00
Justin Cormack
51b4e20154 Merge pull request #103 from ijc/master
Build for Darwin and Windows
2017-07-11 11:07:36 +01:00
Ian Campbell
6c6499bdd5 Update docker/docker vendor to 6978a6e25a2e6063f280ec842bd0f3eae99426e1
This includes https://github.com/moby/moby/pull/34040 which fixes Windows build
issues.

Note that this pulls in more than 500 (non merge) commits as well as the fix we
are interested in. A couple of new deps are pulled in, versions taken from
vendor/github.com/docker/docker/vendor.conf.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-07-11 10:47:39 +01:00
Justin Cormack
5bf74cbfa9 Merge pull request #105 from justincormack/unique-names
Error if there are duplicate service names
2017-07-11 10:22:05 +01:00
Justin Cormack
3ee4fdc43a Error if there are duplicate service names
Continue to allow onboot to have duplicates as we do not run simultaneously
so that is ok (and we number them anyway), but services are run together
so we will get a runtime error if duplicated as this is the containerd/runc
id.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-10 14:50:04 +01:00
Ian Campbell
3c5fad4539 Remove dependency on docker/docker/cli
We were pulling in this whole stack of packages just for `trust.ReleasesRole`.
Just define it locally.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-07-10 14:38:21 +01:00
Justin Cormack
ec7e73b304 Merge pull request #100 from justincormack/userns
Add partial user namespace support
2017-07-10 14:30:30 +01:00
Ian Campbell
5e75f8ca8b Only run go test and go vet if not cross building (i.e. ${GOOS} unset)
They will try to run things and hence cannot be done when cross building.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-07-07 10:27:19 +01:00
Ian Campbell
48f1dd042f Build for Darwin and Windows in CI
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-07-06 17:51:43 +01:00
Justin Cormack
d87a3f9990 Merge pull request #102 from ijc/master
revendor runc + runtime-spec to match containerd 8e1a04ff9ee3
2017-07-06 16:57:01 +02:00
Ian Campbell
c3edfec759 revendor runc + runtime-spec to match containerd 8e1a04ff9ee3
Note that various fields have changed moved around in the JSON as a result:

* `Platform` has been removed.
* `Process` is now a pointer.
* `OOMScoreAdj` has moved into `Process`, from `Linux.Resources` (resolving a
  TODO here).

Also updates golang.org/x/sys which is less critical.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-07-06 15:34:01 +01:00
Justin Cormack
a73c3d3667 Add partial user namespace support
This adds the OCI parts needed into the yaml, but there are still
permissions issues in practise so marked as experimental.

It may just need further documentation to resolve the issues.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-03 14:45:58 +01:00
Justin Cormack
c7c4c9ef2a Merge pull request #98 from justincormack/named-uids
Assign each container a uid and gid it can use
2017-06-30 19:40:47 +01:00
Justin Cormack
0acaaa71fe Assign each container a uid and gid it can use
In order to support not running containers as root, allocate
each of them a uid and gid, a bit like traditional Unix system
service IDs. These can be referred to elsewhere by the name of
the container, eg if you wish to create a file owned by a
particular esrvice.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-30 17:40:08 +01:00
Justin Cormack
e9b9c56137 Merge pull request #99 from justincormack/ambient-docs
Add docs for ambient capabilities
2017-06-30 17:17:46 +01:00
Justin Cormack
c5070dfc8c Add docs for ambient capabilities
Missed in intitial PR.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-30 17:05:34 +01:00
Justin Cormack
5f49f6695a Merge pull request #97 from justincormack/ambient
Add support for ambient capabilities
2017-06-30 14:41:40 +01:00
Justin Cormack
66b4aed239 Add support for ambient capabilities
Allow setting ambient capabilities, as a seperate option to the standard
ones. If you are running as a non root user you should use these.

Note that unless you add `CAP_DAC_OVERRIDE` and similar permissions you
need to be careful about file ownership. Added support to set ownership
in the `files` section to help out with this.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-30 14:08:16 +01:00
Justin Cormack
70c5c2e1a0 Merge pull request #94 from davefreitag/ibm-vhd
Adding 'dynamic-vhd' Output Format
2017-06-27 15:29:20 +01:00
Justin Cormack
518fd2b0d6 Merge pull request #93 from tych0/check-caps
check that caps are valid
2017-06-27 15:28:52 +01:00
Tycho Andersen
c2e460fee5 check that caps are valid
Rather than build the image and have something weird happen, let's check
that the capabilities specified are actually valid capabilities.

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-06-27 08:25:10 -06:00
Dave Freitag
b605e61d1f Adding dynamic-vhd Output Format
Adding support for the dynamic-vhd output format.

Signed-off-by: Dave Freitag <dcfreita@us.ibm.com>
2017-06-27 08:53:56 -05:00
Justin Cormack
31384b6780 Merge pull request #91 from justincormack/library
Split out into a small stub command line and a library
2017-06-23 11:58:18 -07:00
Justin Cormack
e7ebabdb05 Split out into a small stub command line and a library
- this is pretty much the smallest change to split this out and it
  exposes a few things that can be improved later
- no change to logging yet

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-21 16:19:31 -07:00
Justin Cormack
a7e3fd29b4 Merge pull request #90 from justincormack/dockerinput
Rename the docker run function
2017-06-21 11:17:07 -07:00
Justin Cormack
4401e7d0f0 Rename the docker run function
This is a remnant of when there were multiple versions.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-21 11:10:38 -07:00
Justin Cormack
c9d8739b32 Merge pull request #86 from justincormack/error
Return errors from build internal function
2017-06-20 20:16:42 -07:00
Justin Cormack
c5cccad62e Return errors from build internal function
This makes it easier to convert to a library.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-20 17:25:16 -07:00
Justin Cormack
7149b0f7b8 Merge pull request #85 from justincormack/empty
Allow creation of empty files
2017-06-20 13:34:09 -07:00
Justin Cormack
618dc424de Allow creation of empty files
- change to a pointer type so we can distinguish empty from unset.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-20 13:25:36 -07:00
Justin Cormack
b928a9b203 Merge pull request #84 from justincormack/rlimit
Add support for rlimits
2017-06-18 15:37:04 -07:00
Justin Cormack
ad3de8f858 Add support for rlimits
Use a microformat eg `nofile,100,200`. You can use `unlimited`
to set no limit.

Needed for https://github.com/linuxkit/linuxkit/issues/1852

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-17 16:37:24 -07:00
Justin Cormack
2e22b3adc6 Merge pull request #83 from justincormack/hyperkit-support
Use hyperkit to make raw disks
2017-06-15 16:31:59 -07:00
Justin Cormack
13da5e08ea Use hyperkit to make raw disks
- enable the hyperkit option by default on MacOS
- use it for creating raw disk images

fix #68

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-15 15:10:55 -07:00
Justin Cormack
d8cc1b3f08 Merge pull request #82 from justincormack/source-ifpresent
Allow some files specified with `source` to be optional
2017-06-15 11:22:21 -07:00
Justin Cormack
4d64a46ae9 Allow some files specified with source to be optional
See discussion in https://github.com/linuxkit/linuxkit/pull/2027

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-15 11:07:58 -07:00
Justin Cormack
d534273407 Merge pull request #81 from ijc/no-default-hostname
Do not force default hostname `moby`.
2017-06-13 17:42:18 +02:00
Ian Campbell
755c6a0bf7 Do not force default hostname moby.
This disables the code in LinuxKit's `/bin/rc.init` which attempts to detect an
unconfigured hostname and generate a unique (ish) version from the MAC address.

Anyone who wants a specific fallback hostname can populate `etc/hostname`
through the `files` stanza in their `yml` file.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-13 16:37:42 +01:00
Justin Cormack
464396c63f Merge pull request #80 from justincormack/http-fetch-yaml
Add support to fetch yaml file with http
2017-06-13 16:58:51 +02:00
Justin Cormack
d7ca674ea6 Add support to fetch yaml file with http
For example you can do
```
moby build https://raw.githubusercontent.com/linuxkit/linuxkit/master/linuxkit.yml
```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 18:11:21 +02:00
Justin Cormack
90fd3e7e41 Merge pull request #79 from justincormack/tilde
Allow ~ for home directory when specifying source of file
2017-06-12 16:43:28 +02:00
Justin Cormack
1988b312d2 Allow ~ for home directory when specifying source of file
Useful when adding ssh keys

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 16:37:00 +02:00
Justin Cormack
e94d0d8093 Merge pull request #78 from justincormack/add-initrd
Move the initrd library to this repo
2017-06-12 15:43:47 +02:00
Justin Cormack
322d06f906 Update vendoring to use initrd library from this repo
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:36:30 +02:00
Justin Cormack
528b430789 Clean up initrd creation library
Remove duplicated code and clean up file handling a little.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:34:30 +02:00
Justin Cormack
ddc92b8846 Code in the initrd generator to split a single tarball
In the WIP code in `moby` we now have a standard base tarball format,
that includes the kernel and cmdline as files in `/boot` so that the
entire output of the yaml file can default to a single tarball. Then
this can be split back up by LinuxKit into initrd, kernel and cmdline
as needed. This will probably become the only output of the `moby build`
stage, with a `moby package` stage dealing with output formats.

We may remove the output format specification from the yaml file as well,
and just have it in the command.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:34:22 +02:00
Justin Cormack
ecf14815f7 Update Go path to linuxkit/linuxkit for libraries
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:34:11 +02:00
Tycho Andersen
c313e39250 init: fake supporting hard links slightly differently
Instead, make a hard link a symlink. This isn't much better, but it allows
some cases (e.g. installing GCC on moby via alpine) to work.

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-06-12 15:34:02 +02:00
Justin Cormack
6bce274b81 Move Go code to src/cmd
This does not get everything where we want it finally, see #1266
nor the optimal way of building, but it gets it out of top level.

Added instructions to build if you have a Go installation.

Not moving `vendor` yet.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:33:53 +02:00
Justin Cormack
49002e7a1d Out with the old, in with the new Moby
- remove remainder of editions code
- add a new check container to run tests without Docker
- switch over `make test` to use new command to build tests

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:33:45 +02:00
Justin Cormack
ed832e185f Rough first version of the moby tool
- terrible code
- lots needs changing
- can build a Moby from a config yaml that boots

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 15:33:34 +02:00
Justin Cormack
6b4bae6832 Merge pull request #77 from justincormack/tar-abs
Remove absolute paths from files
2017-06-09 11:49:26 +01:00
Justin Cormack
796d943054 Remove absolute paths from files
tarballs should only have relative paths in.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-09 11:39:52 +01:00
Justin Cormack
e7fc277fd2 Merge pull request #76 from justincormack/docs
Add docs
2017-06-08 15:53:54 +01:00
Justin Cormack
eea5c6f126 Updates to the docs
Some of this was out of date or missing.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-08 15:45:49 +01:00
Justin Cormack
0eb4a49b24 Import yaml documentation from LinuxKit
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-08 14:58:29 +01:00
Justin Cormack
35ee128bfd Merge pull request #75 from justincormack/perm
Allow setting of mode in files section
2017-06-08 14:54:39 +01:00
Justin Cormack
83c166d3f2 Allow setting of mode in files section
Also keep track of directory creation there, so you can explicitly
set directory permissions if required, and to avoid duplicates.

We should really keep track of files created elsewhere in the build
as well as we still might create some extras, but at least you can
set the write permisisons.

We can add uid, gid support too if required...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-08 14:44:02 +01:00
Justin Cormack
e0aac90f44 Merge pull request #74 from justincormack/raw-name
Fixes for output types
2017-06-07 16:52:35 +01:00
Justin Cormack
98732e8936 Fixes for output types
Make `raw` output type call its file `.raw` as well, other minor fixes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 16:46:36 +01:00
Justin Cormack
68ffbb5e7e Merge pull request #72 from justincormack/rename-images
Rename img→raw and gcp-img→gcp
2017-06-07 16:38:29 +01:00
Justin Cormack
d906292096 Merge pull request #73 from justincormack/docker
Add an output format for running images with Docker
2017-06-07 16:38:14 +01:00
Justin Cormack
9a3ac36236 Add an example of building an application and running in Docker or LinuxKit
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 16:24:32 +01:00
Justin Cormack
dbe50976c3 Add suitable init for running in a container
This goes with the experimental `docker` output format.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 15:33:52 +01:00
Justin Cormack
8abeffde59 Add Docker output format
This will add a Dockerfile which will build the contents into an
image and then call `tinit` to start it.

This is fairly experimental, but is a prototype for other non
LinuxKit outputs. The container will need to run as `privileged`
as `runc` needs quite a few capabilities and `containerd` needs to
mount.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 15:32:02 +01:00
Justin Cormack
eabe03b702 Rename img→raw and gcp-img→gcp
- generally people refer to a plain disk image as `raw`
- `gcp` is shorter and it is the only image type supported
- remove `img-gz` as it is not needed. It does not really save space
  as you have to build the full image and compress it anyway. On
  many platforms the `raw` image will be a sparse file anyway,
  even on the Mac soon.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 14:43:43 +01:00
Justin Cormack
ca677b3c40 Merge pull request #71 from justincormack/output-file
Use streaming output where possible
2017-06-07 14:28:44 +01:00
Justin Cormack
c2806000e0 Use streaming APIs rather than buffers for building
This should lower memory usage a lot and should be faster.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 12:13:12 +01:00
Justin Cormack
b086231008 Allow streaming output for tar
This is a little ugly in terms of the validation now, but it is a move towards
splitting "build" and "package".

The "tar" output (and soon others) can output direct to a file or to stdout.
Obviously you can only build a single output format like this.

The LinuxKit output formats that build disk images cannot stream as they
have to build whole images. These allow multiple outputs.

In future we will probably change to
```
moby build | moby package
```

or similar, but that is a bit ugly, so currently have a compromise where
there are essentially two output types.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-06 14:50:28 +01:00
Justin Cormack
181c66d42c Merge pull request #70 from justincormack/multiple-yaml
Allow specification of multiple yaml files for a single build
2017-06-05 16:39:31 +01:00
Justin Cormack
3a16c02f10 Merge pull request #69 from justincormack/gcp-fix
Do not use Linuxkit to build GCP images for now
2017-06-05 15:37:48 +01:00
Justin Cormack
e879037646 Disable use of linuxkit for GCP for now
GCP does not recognise the images, even though they appear identical to those made
by libguestfs and work on qemu fine. Their validation code does not like them for some
reason.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-05 15:31:45 +01:00
Justin Cormack
503545a2de Merge pull request #67 from riyazdf/trust-caching
trust: check local image cache to not pull every time
2017-06-04 19:31:47 +01:00
Justin Cormack
54e58f2808 Allow specification of multiple yaml files for a single build
Each section will be appended in order of the CLI, other then
kernel where last specified one wins.

This is useful if you eg want to have a base version for (say)
AWS and GCP and then add your own image on top.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-04 17:50:13 +01:00
Riyaz Faizullabhoy
6c6190172c trust: include trust configuration in docker inspect for OCI config
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-02 15:18:55 -07:00
Justin Cormack
058ce768f4 Merge pull request #66 from justincormack/linuxkit-part2
Add the temporary directories under ~/.moby
2017-06-02 22:39:41 +01:00
Justin Cormack
5b73f53dcf Put tmp direcories under ~/.moby
Docker4Mac won't bind mount default tmp dir into containers

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-02 22:36:21 +01:00
Riyaz Faizullabhoy
6221552204 trust: check local image cache to not pull every time
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-02 13:03:47 -07:00
Justin Cormack
294389aef9 Merge pull request #49 from justincormack/linuxkit
Use linuxkit to build qcow2 and raw image disks, rather than docker containers with libguestfs
2017-06-02 16:39:28 +01:00
Justin Cormack
249bbc56ed Use linuxkit to build qcow2 and raw image disks, rather than docker containers with libguestfs
- does not require docker if user has qemu natively, will still fall back to docker
- allow specifying size for fixed size disk images
- add a raw disk output format
- more dogfooding
- marginally slower, but can be improved later

The images used to do the build are cached to make the process quicker.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-02 16:33:06 +01:00
Justin Cormack
d599aedb7f Merge pull request #62 from riyazdf/config-dir-trust
add default trust config and cache dir
2017-06-02 16:25:52 +01:00
Riyaz Faizullabhoy
46b77f699f add default config and cache dir, initially use for trust
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-02 08:14:03 -07:00
Justin Cormack
dd60edc884 Merge pull request #65 from justincormack/mobydir
Add a ~/.moby directory for config
2017-06-02 15:16:31 +01:00
Justin Cormack
cf8d8ca014 Add a ~/.moby directory for config
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-02 15:12:00 +01:00
Justin Cormack
cde8329d2f Merge pull request #61 from FrenchBen/validate-output
Validate output before doing the work
2017-06-01 22:39:56 +01:00
Justin Cormack
edcf4d0362 Merge pull request #59 from riyazdf/trust-parse-fixes-and-tests
trust: parsing fixes and tests
2017-06-01 22:35:59 +01:00
French Ben
23856c1e46 Validate output before doing the work
Signed-off-by: French Ben <frenchben@docker.com>
2017-06-01 14:30:41 -07:00
Riyaz Faizullabhoy
e0fc007b5a test cases with default golang lib
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-01 11:27:01 -07:00
Riyaz Faizullabhoy
99eeb981a7 trust: improve org checks to enable library official repo checks
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-01 11:20:36 -07:00
Justin Cormack
dec7f8bb2b Merge pull request #58 from riyazdf/disable-trust-flag
add disable-content-trust flag for one-off build
2017-06-01 10:52:36 +01:00
Riyaz Faizullabhoy
32f167bd9e trust: fix splitting on tags and digests and add tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-31 16:42:42 -07:00
Riyaz Faizullabhoy
1ecfc11160 add disable-content-trust flag for one-off build
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-31 14:51:59 -07:00
Justin Cormack
5cd1e4e2ae Merge pull request #56 from justincormack/host-root
Change the default namespaces
2017-05-30 15:35:01 +01:00
Justin Cormack
dfd57aeeee Change the default namespaces
Default to sharing net, ipc, uts namespaces between containers in config.
This makes most sense, as this is normal other than if we want to specifically
isolate system containers, in which case we will specify in config.

- explicitly support the value "new" if you want to isolate
- support the synonym "root" for "host" as in non LinuxKit setups it may
  not actually be the host, it will be the current namespace.
- only support "none" as a synonym for "new" for network namespace where it is
  carried over from Docker.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-30 14:41:33 +01:00
Justin Cormack
101fa30ef3 Merge pull request #54 from riyazdf/trust-tag-fix
trust: always tag after pull
2017-05-27 10:33:27 +01:00
Riyaz Faizullabhoy
81d17913d1 trust: always tag after pull
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-26 18:44:58 -07:00
Justin Cormack
5111146a4f Merge pull request #53 from riyazdf/rbind
Always include rbind in user-specified volume options
2017-05-26 23:56:06 +01:00
Riyaz Faizullabhoy
11ebab55e2 Always include rbind in user-specified options
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-26 15:39:57 -07:00
Justin Cormack
4e4629e05c Merge pull request #51 from riyazdf/trust-tmpdir
trust: use a tempdir and remove after build
2017-05-26 22:47:37 +01:00
Riyaz Faizullabhoy
92aa526b9d trust: use a tempdir and remove after build
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-26 14:29:44 -07:00
Justin Cormack
e8dc61e910 Merge pull request #48 from justincormack/dir-fixes
Fix build in directory
2017-05-26 15:28:18 +01:00
Justin Cormack
b8cdb985fd Fix build in directory
Remove unnecessary argument to buildInternal function, does not need to know the name.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 15:22:12 +01:00
Justin Cormack
2cd3a5b141 Merge pull request #47 from justincormack/dir
Add a -dir option for location of output files
2017-05-26 15:02:29 +01:00
Justin Cormack
f73558a98a Add a -dir option for location of output files
Fix #17

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 14:53:17 +01:00
Justin Cormack
5de12a0085 Merge pull request #46 from justincormack/gitignore
Fix gitignore to not ignore moby directory
2017-05-26 14:47:45 +01:00
Justin Cormack
27709ce1c0 Fix gitignore to not ignore moby directory
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 14:45:19 +01:00
Justin Cormack
1cb9fab3e1 Merge pull request #45 from justincormack/clean
Add make clean, .gitignore
2017-05-26 13:34:06 +01:00
Justin Cormack
f6b9076649 Merge pull request #43 from justincormack/outputs-not-in-yaml
Remove output formats from the Yaml file, put in CLI
2017-05-26 13:33:17 +01:00
Justin Cormack
cbbedbfc57 Remove output formats from the Yaml file, put in CLI
This removes outputs from yaml, instead you can do
```
moby build -output tar -output qcow2 file.yaml
```
or alternative syntax
```
moby build -output tar,qcow2 file.yaml
```

In future we may change this to be available in a `moby package`
step, but lets try this for now.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 13:00:45 +01:00
Justin Cormack
dfd1cd9c1c Add make clean, .gitignore
Also tidy Makefile a bit

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 12:47:06 +01:00
Justin Cormack
f65146c844 Merge pull request #41 from riyazdf/remove-run
Remove docker run function as it is unused
2017-05-26 10:43:56 +01:00
Justin Cormack
ff4a19c5fb Merge pull request #44 from AkihiroSuda/fix-tmpfs
config: fix tmpfs parsing
2017-05-26 10:42:22 +01:00
Akihiro Suda
41c536908d config: fix tmpfs parsing
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-05-26 08:24:48 +00:00
Riyaz Faizullabhoy
dfca3b9775 Remove docker run function as it is unused
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-23 13:30:29 -07:00
Justin Cormack
b47f3dec4a Merge pull request #27 from chanwit/add_source
add Source attribute to File
2017-05-22 11:28:06 +01:00
Justin Cormack
339aa5ec86 Merge pull request #39 from justincormack/nullable
Add support for override of parameters using a label
2017-05-18 23:09:37 +01:00
Justin Cormack
c734b47e9c Add support for override of parameters using a label
Using the label `org.mobyproject.config` will use that JSON
(or yaml, but it is very hard to get yaml into a label as newlines are
not respected) for parameters that are not explicitly set in the yaml file.

Had to change parameter definitions so override behaves as expected.

fix #16

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-18 17:48:15 +01:00
Justin Cormack
df7f50a755 Merge pull request #37 from riyazdf/circle-fix
Fixup circle CI
2017-05-15 19:59:51 +01:00
Riyaz Faizullabhoy
57f1a5bdf2 Fixup circle CI
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-15 11:55:53 -07:00
Justin Cormack
219847ff1a Merge pull request #36 from riyazdf/fix-circle
Update working dir and get golint for circle tests
2017-05-15 18:25:45 +01:00
Riyaz Faizullabhoy
62f8a69b38 Update working dir and get golint for circle tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-15 10:17:16 -07:00
Justin Cormack
b48e969bf8 Merge pull request #34 from riyazdf/simple-test
Simple test target
2017-05-15 17:59:22 +01:00
Riyaz Faizullabhoy
039e4f6f60 Change to tar output
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-15 09:58:26 -07:00
Justin Cormack
d7611ee0e3 Merge pull request #35 from justincormack/windows-fixes
Update vendoring for Windows support
2017-05-15 17:36:29 +01:00
Justin Cormack
5a226337a9 Update vendoring for Windows support
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-15 17:32:10 +01:00
Riyaz Faizullabhoy
d020a54aa7 Sample circle yml, not hooked in yet
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-15 09:27:34 -07:00
Riyaz Faizullabhoy
39d74773fc Simple make test target
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-15 09:27:29 -07:00
Justin Cormack
a9a00fae62 Merge pull request #33 from justincormack/img-gz
Add a compressed disk image format
2017-05-12 14:43:13 +01:00
Justin Cormack
1274f81f81 Add a compressed disk image format
This is a fairly generic bootable disk with syslinux. Should
work if you dd it onto a USB stick, and should also work for AWS.

You need to uncompress it of course! Default size is 1G.

Will add cli option to set the size once I split out `moby build`
and `moby package` shortly.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 14:29:14 +01:00
Justin Cormack
1135cdddcc Merge pull request #32 from justincormack/fix-pull
Fix docker pull
2017-05-12 13:08:17 +01:00
Justin Cormack
0ade84e151 Fix docker pull
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 13:04:19 +01:00
Justin Cormack
91e78b73b9 Merge pull request #31 from justincormack/fix-exec
Add missing import
2017-05-12 11:42:03 +01:00
Justin Cormack
8a71fbdbb6 Add missing import
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 11:41:37 +01:00
Justin Cormack
9afbc24c79 Merge pull request #30 from riyazdf/revert-run-api
Revert "Use Docker API for run"
2017-05-12 11:31:33 +01:00
Justin Cormack
4bef9648f9 Merge pull request #18 from riyazdf/docker-pull-api
implement docker pull using docker API + notary library
2017-05-12 11:30:49 +01:00
Riyaz Faizullabhoy
e26f2878d3 Revert "Use Docker API for run"
This reverts commit ec6fea1d67.
2017-05-11 17:32:32 -07:00
Chanwit Kaewkasi
d83c35259a add Source attribute to File
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2017-05-12 01:01:53 +07:00
Riyaz Faizullabhoy
9afeda3c78 Vendoring for notary
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-11 10:11:38 -07:00
Riyaz Faizullabhoy
abf0028ee8 Use docker and notary API for pull
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-11 10:11:19 -07:00
Justin Cormack
ba07bbfb0d Merge pull request #26 from justincormack/gitignore-del
Remove .gitignore
2017-05-10 17:00:17 +01:00
Justin Cormack
0ea9dfdfe1 Remove .gitignore
Was ignoring too much...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-10 16:59:25 +01:00
Justin Cormack
11b913606d Merge pull request #11 from riyazdf/run-api
Use Docker API for run
2017-05-09 16:31:57 +01:00
Justin Cormack
0a06eb2cea Merge pull request #25 from justincormack/fix-symlinks-misc
Fix symlinks handling in initramfs
2017-05-09 13:54:17 +01:00
Justin Cormack
fbdd5047dd Update linuxkit vendor
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:45:48 +01:00
Justin Cormack
6187570b7a Add missing Close in initrd creation
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:34:41 +01:00
Justin Cormack
cc2a3a645f Add support for symlinks in files section
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:15:11 +01:00
Justin Cormack
96ae98d2d5 Do not log information about empty sections
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:12:51 +01:00
Justin Cormack
e25033f70d Allow no kernel to be specified
This is needed for non LinuxKit use cases.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:03:58 +01:00
Justin Cormack
a1b24b4de2 Merge pull request #24 from MagnusS/fix-build
Don't exit after pulling init or kernel image without -pull
2017-05-08 20:14:03 +01:00
Magnus Skjegstad
09c2904994 Don't exit after pulling init or kernel image
Due to a missing else the tool would previously terminate with an error
message showing that the kernel or init image didn't exist, even if it
was pulled successfully. Invoking the tool again would continue to the
next image.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-08 20:48:20 +02:00
Justin Cormack
86b4d1cdb2 Merge pull request #23 from justincormack/fmt
Go fmt
2017-05-08 17:50:44 +01:00
Justin Cormack
7c33eb81b6 Go fmt
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 17:50:11 +01:00
Justin Cormack
aa51e43be9 Merge pull request #22 from justincormack/tar-boot-rework
Add tar output format
2017-05-08 17:31:01 +01:00
Justin Cormack
dd08b2b70a Add tar output format
Add a canonical single tarball output format. This
adds kernel and cmdline to `/boot` where LinuxKit output
formats will find them.

Make the other output formats use that as a base.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 17:19:08 +01:00
Justin Cormack
30d6bc5f5a Merge pull request #21 from justincormack/vndr-cleanup
Revendor with a newer `vndr`
2017-05-08 17:12:05 +01:00
Justin Cormack
20bf9d44ea Revendor with a newer vndr
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 17:10:44 +01:00
Justin Cormack
3e3eec7642 Merge pull request #13 from riyazdf/linting
Add standard lint tools to Makefile
2017-05-03 16:47:09 +01:00
Riyaz Faizullabhoy
b93922a1c5 Add standard lint tools to Makefile
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-01 10:49:54 -07:00
Justin Cormack
45a3e4ccd2 Merge pull request #15 from alexellis/support_none
Support `capabilities: none` in YML - Fix #14
2017-05-01 16:35:57 +01:00
Alex Ellis
b046618027 Support none as capabilities.
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-05-01 16:08:23 +01:00
Justin Cormack
0b149e7c83 Merge pull request #12 from riyazdf/img-not-found-err
Use IsErrNotFound to tighten err handling
2017-05-01 11:22:28 +01:00
Riyaz Faizullabhoy
95a9a4ff67 Use IsErrNotFound to tighten err handling
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-28 10:50:58 -07:00
Riyaz Faizullabhoy
ec6fea1d67 Use Docker API for run
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-28 10:45:37 -07:00
Justin Cormack
d504afe479 Merge pull request #10 from justincormack/pull-before-create
Make sure we always pull images if create fails
2017-04-28 16:23:36 +01:00
Justin Cormack
d0f867e9b2 Make sure we always pull images if create fails
`docker create` will not pull an image so we need an additional fallback.

Rework the pull and trust code so it is in one place to facilitate this.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 16:14:15 +01:00
Justin Cormack
dbd2593328 Merge pull request #8 from justincormack/no-bzimage
Switch from bzImage to kernel for kernel image
2017-04-28 13:56:59 +01:00
Justin Cormack
ef017ac223 Support both kernel and bzImage for now
Also do not require `tar` to be in container, use the standard
image export code that we already have and find the files we
want.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 12:48:04 +01:00
Justin Cormack
2cd9bead88 Switch from bzImage to kernel for kernel image
This was too architecture specific previously.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 12:38:04 +01:00
Justin Cormack
3375f32d51 Merge pull request #9 from riyazdf/docker-api-usage
Use Docker API for part of tool
2017-04-28 11:48:52 +01:00
Riyaz Faizullabhoy
37f57cfa84 Use Docker API for rm, create, export, and inspect
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-27 14:09:17 -07:00
Riyaz Faizullabhoy
fcdfe5c356 vendor new client and api
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-27 13:31:16 -07:00
Justin Cormack
4694f5a7ec Merge pull request #7 from justincormack/makefile
Add a simple Makefile
2017-04-27 14:29:26 +01:00
Justin Cormack
719025a708 Add a simple Makefile
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-27 14:25:07 +01:00
Justin Cormack
7517c830d7 Merge pull request #6 from AkihiroSuda/stdin
build: support reading yaml from stdin
2017-04-27 14:12:34 +01:00
Akihiro Suda
d98f23c2ba build: support reading yaml from stdin
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-04-25 10:26:34 +00:00
Justin Cormack
75a784f74b Merge pull request #3 from justincormack/clean-vendor
Clean vendor directory
2017-04-25 00:07:00 +01:00
Justin Cormack
08e1ca0795 Clean vendor directory
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-25 00:06:11 +01:00
Justin Cormack
3527ecc6d9 Merge pull request #2 from justincormack/license
Add license files
2017-04-24 23:09:21 +01:00
Justin Cormack
ba3d79a258 Add license files
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 23:08:30 +01:00
Justin Cormack
8fa71bd1a9 Merge pull request #1 from justincormack/vendor
Add vendoring and move to cmd
2017-04-24 23:07:08 +01:00
Justin Cormack
fa88ca8ede Move src/cmd to cmd
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 22:58:37 +01:00
Justin Cormack
81288f9221 Add vendoring
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 22:56:08 +01:00
Justin Cormack
8968335e59 Split cli into moby and linuxkit
moby just does the simple `build` cases, while `linuxkit` does
`push` and `run`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 20:03:22 +01:00
Justin Cormack
4e1317d213 Split build and push, and remove push code from run
This currently only changes the `gcp` target, but is the new
model - the `build` command will only do things locally, then
you need to `push` to an image store such as GCP or other ones
in order to `run` for platforms that cannot boot directly from
a local image.

Fix #1618

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 17:12:05 +01:00
Dave Tucker
b556f51b47 moby: Add container fallback for moby run qemu
This commit allows moby run qemu to fallback to using a container if
qemu isn't installed on the host OS

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-24 15:16:57 +01:00
Rolf Neugebauer
9deb9c044d src: Use hyperkit from the the moby org
HyperKit got moved from docker to moby. Update vendoring and
imports.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-24 10:53:59 +01:00
Riyaz Faizullabhoy
c1a5c412fb Merge pull request #1653 from dave-tucker/ltp-ci
Changes required to run LTP tests in CI
2017-04-23 13:22:40 -07:00
Dave Tucker
327138876a moby: add skip-cleanup flag to moby run gcp
This is used as the CI will cleanup after itself

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-19 16:02:48 +01:00
Daniel Finneran
85b33baf58 Fix for prefix for linuxkit
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-18 19:00:31 -05:00
solidnerd
bd8017a4e1 Rename package initrd in build.go
This will rename github.com/docker/moby/src/initrd to github.com/linuxkit/linuxkit/src/initrd

Signed-off-by: solidnerd <niclas@mietz.io>
2017-04-18 20:19:21 +02:00
Rolf Neugebauer
49d735bc2f cli: Unify environment variables for GCP run
GCP defines some "standard" environment variables for project and
zone. Use them for 'moby run gcp'. Change the other environment
variables to follow the same pattern.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-15 12:36:46 -05:00
Rolf Neugebauer
481d584659 cli: Update images to use the linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Ilya Dmitrichenko
31f5a0baa8 Generate VM UUID
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2017-04-12 17:33:26 +01:00
Thomas Gazagnaire
4504e6d386 fix yaml validation for image mounts
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 15:28:02 +02:00
Justin Cormack
8f18d92bee Merge pull request #1599 from avsm/packet-net-run
Add `moby run packet` to boot on baremetal Packet.net hosts
2017-04-12 13:40:50 +01:00
Thomas Gazagnaire
b9a964060b better comment in converter for yaml validation
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 14:10:27 +02:00
Anil Madhavapeddy
0175778e83 Add moby run packet to boot on baremetal Packet.net hosts
This uses the Packet.net API and iPXE to boot a Moby host.
There are several enhancements coming soon, such as SSH key
customisation, but this PR is sufficient to boot a host and
then use the web interface to get console access.

The user must currently upload the built artefacts to a public
URL and specify it via --base-url, e.g.:
moby run packet --api-key <key> --project-id <id> \
  --base-url http://recoil.org/~avsm/ipxe --hostname test-moby packet

See #1424 #1245 for related issues.

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2017-04-12 12:59:05 +01:00
Thomas Gazagnaire
02038f512d Add Yaml validation
Fix #1292

Transform the Yaml struct to JSON and validate it against a JSON schema.

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 13:42:15 +02:00
Justin Cormack
c9c6d20a45 Merge pull request #1596 from thebsdbox/qemu_raw_disk
Fixed qemu argument typo and also correct use of raw disk
2017-04-12 12:03:33 +01:00
thebsdbox
f7210ab4b4 Fixed qemu argument typo and also correct use of raw disk
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-12 11:19:58 +01:00
Dave Tucker
d5264ac9e7 moby: Add system disk and disk size parameter to GCP
This makes gcp behave in a similar way to the qemu backend.
The minimum size on GCP 1GB, whereas qemu uses 256MB.
Without this, the LTP tests fail on GCP.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-12 00:52:01 +01:00
Dave Tucker
52f62bb30c moby: enable internet access for GCP VM's
Adds an "access config" with a type of "ONE_TO_ONE_NAT" that
allows an instance to obtain an ephemeral IP address and access the
internet

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-11 23:36:31 +01:00
thebsdbox
b6e8d4fd63 Added Linux $PATH support and fixed FlagSet typo
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-11 11:48:51 +01:00
Anil Madhavapeddy
eae5422a0d tweak moby run CLI help to reflect that it supports GCP as well
Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2017-04-11 11:18:55 +01:00
Justin Cormack
5527a3b6a1 Merge pull request #1577 from riyazdf/errchecking
catch and handle errors in src/cmd/moby
2017-04-10 21:48:41 +01:00
Riyaz Faizullabhoy
37adb881f7 catch and handle errors in src/cmd/moby
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-10 13:36:46 -07:00
Riyaz Faizullabhoy
0aaeb92a44 qemu: catch error on disk create and exit with message
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-10 12:09:54 -07:00
Justin Cormack
d11a78982a Merge pull request #1571 from dave-tucker/panic
Fix panic in gcp code
2017-04-10 17:37:52 +01:00
Dave Tucker
7d519cb9b8 moby: use type assertion to avoid panic in gcp code
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-10 17:29:59 +01:00
Rolf Neugebauer
650d9011f4 cli: Adjust run_hyperkit to changed API
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-10 15:56:20 +01:00
Justin Cormack
66467544be Merge pull request #1521 from thebsdbox/qemu
CLI: Added qemu backend
2017-04-09 13:56:09 +01:00
thebsdbox
3446edbd0b CLI: Added qemu backend
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-09 13:49:00 +01:00
Riyaz Faizullabhoy
bd2211b645 trust: clean up logic for digests and orgs
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-08 17:25:18 -07:00
Justin Cormack
8176403426 system → onboot daemon → services
As suggested by @shykes these are clearer

- onboot for things that are run at boot time to completion
- services for persistent services

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-08 16:56:47 +01:00
Riyaz Faizullabhoy
68d8788e3b Enforce content trust with trust key and yaml subkeys for image and org
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-07 16:29:25 -07:00
Dave Tucker
799879d76d moby: Add -img-name flag to moby run gcp
This allows overriding the name used of the file in google storage,
image name or instance name. This will vary depending on how much `moby
run` is doing which is goverened by whether the positional argument
contains an `.img.tar.gz` or not.

For example:

`moby run gcp -img-name test-ea34d1 test` creates an instance called
`test-ea34d1` from the image `test`

`moby run gcp -img-name test-ea34d1` test.img.tar.gz` will upload the
file as `test-ea34d1.tar.gz`, create image `test-ea34d1` and create an
instance called `test-ea34d1`.

The use case for this is for CI to be able to spawn many concurrent test
machines and provide it's own name for them.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-07 15:35:54 +01:00
Dave Tucker
0d8850d5d1 moby: Allow combination of env vars and flags for gcp
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-07 15:22:27 +01:00
Justin Cormack
7e1f2088d3 Make init accept a list of images not just a single one.
fix #1527

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-07 14:25:28 +01:00
Justin Cormack
be9ee95c4c Write the initrd incrementally
Slightly better for demo flow as no long pause at the end

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-07 11:37:40 +01:00
Rolf Neugebauer
2cce03f19e cli: Add option to the IP address for HyperKit VM
Note: This currently requires a custom version of VPNKit.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-07 10:52:40 +01:00
Justin Cormack
7a5cdfd90c Merge pull request #1530 from ijc25/create-directories-from-yaml
Support creating of directories in files section
2017-04-07 10:28:23 +01:00
Ian Campbell
a3ac69639b Support creating of directories in files section
e.g.
    files:
     - path: etc/docker/daemon.json
       contents: '{"debug": true}'
     - path: var/lib/mydaemon
       directory: true

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-07 09:55:18 +01:00
Justin Cormack
430f03b6a0 Merge pull request #1522 from dave-tucker/gce-gcp
Use GCP everywhere for consistency
2017-04-06 17:27:15 +01:00
Dave Tucker
78c49b247a moby: Add gcp platform to usage in moby run
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-06 17:10:04 +01:00
Dave Tucker
420661277a moby: Replace references to GCE with GCP
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-06 17:00:53 +01:00
Justin Cormack
57e2076031 Add more OCI features
- masked paths
- readonly paths
- allow attaching to existing namespaces, eg if bind mounted by a system container

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-06 15:05:08 +01:00
Justin Cormack
781b05da9d Merge pull request #1514 from rneugeba/cli-up
Improvements to the CLI
2017-04-06 13:01:58 +01:00
Rolf Neugebauer
048218f7c8 cli: Add a 'version' version
Pass version and git commit hash from the Makefile
into main.go. Add a 'version' subcommand to print
the information.

While at it also tweak the help output to only print the
command name and not the entire path.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-06 12:29:52 +01:00
Rolf Neugebauer
ae4b9ba897 cli: Fix "build" when the basename contains a "."
Something like "moby-4.10.yml" did not work when invoked
like "moby build moby-4.10".

While at it, also allow .yaml as an extension.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-06 10:55:18 +01:00
Justin Cormack
d0aff83a21 Add more OCI options
- Sysctl
- CgroupsPath
- RootfsPropagation

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 20:46:16 +01:00
Justin Cormack
1602277ba7 Merge pull request #1492 from dave-tucker/gcp
Add gcp backend for moby run
2017-04-05 15:17:01 +01:00
Justin Cormack
bc1dd84337 Merge pull request #1500 from justincormack/mount-overrides
Allow overriding the default mount options
2017-04-05 15:13:06 +01:00
Justin Cormack
c1c71a7f68 Allow overriding the default mount options
This refactors the mount handling, without changing any defaults.

Any specification of a mount destination will override the default,
so if you want to make `sysfs` read only you can add

```
mounts:
  - type: sysfs
    options: ["ro"]
```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 15:00:13 +01:00
Dave Tucker
6521cd05f8 run: Add gcp backend
This commit implements `moby run gcp` which allows for testing of moby
images on the Google Cloud Platform

This backend attaches (via SSH) to the serial console.
It generates instance-only SSH keys and adds the public key to the
image metadata. These are used by the `moby` tool only.

It will also automatically upload a file and creates an image if the prefix
given to `moby run` is a filename

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-05 14:50:23 +01:00
Dave Tucker
af16e13672 build: Use older GCP API and support service account auth
This commit uses the older GCP API as it supports both compute and
storage. As a result, we can now use either Application Default
Credentials that are generated using the `gcloud` tool or by supplying the
service account credentials in JSON format

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-05 14:50:16 +01:00
Justin Cormack
8d22f19618 Fix typo that meant modules were missing from image
fix #1393 thanks @deitch

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 13:24:42 +01:00
Justin Cormack
a7bda72430 Merge pull request #1496 from justincormack/all-caps
Allow setting capabilities to "all"
2017-04-05 13:04:26 +01:00
Justin Cormack
8de5ab5d74 Add the standard options Docker sets for /proc
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 11:52:17 +01:00
Justin Cormack
475d29eae1 Allow setting capabilities to "all"
This adds every capability. We had this before the OCI changes as we
passed these values to Docker. Makes fully privileged containers less verbose.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-05 11:18:46 +01:00
Justin Cormack
ee2f8bc7e3 Split out OCI generation function
This is to make unit testing easier for #1481

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-04 11:28:30 +01:00
Justin Cormack
69b96d3aa7 Merge pull request #1479 from justincormack/command
Revert Command->Args but remove from yaml where not needed
2017-04-04 10:49:32 +01:00
Justin Cormack
bd87295e43 Revert Command->Args but remove from yaml where not needed
In the riddler change I changed "command" in the yaml to "args"
but did not change the files. In fact we basically used the
default command everywhere so this did not actually break.

Remove the unnecessary "command" lines to simplify yaml.

Revert the command to args change for now as I think I prefer
command, but its easier to switch now. Need to think if the
entrypoint/command distinction matters before finalizing.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-04 09:51:17 +01:00
Justin Cormack
b6b7eb08d2 Disable log driver for docker run
We are generally outputting to stdout pipe which the log driver does
not cope with very well; always did this in older builds.

Saves another 5% of build time.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-04 09:36:25 +01:00
Rolf Neugebauer
c6ba8ab4eb Merge pull request #1447 from thebsdbox/vmware
VMware backend support
2017-04-04 09:07:25 +01:00
Justin Cormack
d293eeadf6 Replace riddler with code that constructs config.json directly
Generated largely from the specified config; small parts taken from `docker image inspect`,
such as the command line.

Renamed some of the yaml keys to match the OCI spec rather than Docker Compose as
we decided they are more readable, no more underscores.

Add some extra functionality
- tmpfs specification
- fully general mount specification
- no new privileges can be specified now

For nostalgic reasons, using engine-api to talk to the docker cli as
we only need an old API version, and it is nice and easy to vendor...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-03 23:28:55 +01:00
Ian Campbell
1477639e09 Update to runc ef9a4b315558d31eae520725ff67383c2f79c3cb
This is compatible with containerd 8353da59c6ae7e1933aac2228df23541ef8b163f
which was picked up by d2caae4c1a.

This required jiggering with riddler output some more to update to new OCI
config.json format for capabilities.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-03 16:47:14 +01:00
thebsdbox
ab2ec26949 VMware Fusion 8.x / Workstation 12+ / VMware VIX vmrun support
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-03 14:19:13 +01:00
Rolf Neugebauer
156aab8b7d cli: Add support for passing meta data to a hyperkit VM
Add a -data option to the HyperKit "run" backend. This either
adds a string or a file to a ISO which is attached to the VM.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:35:45 +01:00
Rolf Neugebauer
2c91f6273f cli: Simplify run_hyperkit.go
Separating command line option parsing from executing hyperkit
makes the code awkward with many parameters passed between functions.

Having everything in one function makes the code simpler.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
681076f1a3 cli: Don't default to "moby" for run
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
397c4332f2 cli: Make the ".yml" extension optional for builds
This provides a consistent UX between build and run:
moby build foo   # build from foo.yml
moby run foo     # boot, e.g., foo-bzImage, foo-initrd.img

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
598dd31a7d cli: Don't default to moby.yml
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-02 19:33:25 +01:00
Rolf Neugebauer
5f9b98e8a7 cli: Use fixed mkimage-iso-efi image
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-01 16:25:02 +01:00
Rolf Neugebauer
35e1444cf2 cli: Add option to specify hyperkit to use
Some users seem to have Docker for Mac/hyperkit in a non-standard
path. Allow them to specify the path to the hyperkit executable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-31 19:21:02 +01:00
Rolf Neugebauer
b64f74bd27 cli: Add support for multiple backends for "moby run"
- Move HyperKit code into a separate file. It should be compilable
  on all supported OSes now.
- Add a (optional) subcommand to "moby run" to select a backend
  i.e., "moby run hyperkit [options] [prefix]"
- On macOS the default is "hyperkit" so that:
  "moby run [options] [prefix]"
  just works
- Add enough command line parsing to make it easy to add new
  backends to the run command
Update help messages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-30 18:59:07 +01:00
Rolf Neugebauer
cc77b36bba cli: Move "run" flag processing into the run implmentation
While at it also fix up the HyperKit run help message.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-30 16:00:06 +01:00
Rolf Neugebauer
df292ed56e cli: Move "build" flag processing into build.go
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-30 15:59:52 +01:00
Rolf Neugebauer
9297e70def moby: Create custom formatter for Info() log events
This formatter strips the prefix from Info() events to
make the default output of "moby build" more readable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 13:43:27 +01:00
Rolf Neugebauer
71ee15c005 moby: Add informational output to build
This adds log.Info() to the main steps of the "moby build"
process. By default the Info() output is shown to the user
so it provides some idea of progress and what is happening.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:53:18 +01:00
Rolf Neugebauer
32b32ea78d moby: Add debug logging to "moby build" code
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:25:28 +01:00
Rolf Neugebauer
6814e21c0a moby: Add verbose and quiet flags to moby commandline
These set the log level to Debug and Error. The default
log level is set to Info.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:25:28 +01:00
Rolf Neugebauer
7c6eca2e8e moby: Switch to use logrus instead of default logger
logrus offers better control over log-levels.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-29 10:25:28 +01:00
Thomas Gazagnaire
0ab9624897 Fix typo in moby run
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-03-28 11:08:28 +02:00
Rolf Neugebauer
9507f102cc Rename .yaml to .yml
docker-compose and other utilities use the .yml extension.
For consistency rename all .yaml to .yml

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-27 09:53:26 +02:00
Riyaz Faizullabhoy
594253b0a8 fmt string fixes
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-03-24 10:19:21 -07:00
Justin Cormack
af846e8014 Add a moby build --pull option to force pulling images
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-24 17:15:34 +00:00
Justin Cormack
630cafe592 Merge pull request #1378 from justincormack/riddler-files
Use Go code to extract rootfs from system containers
2017-03-24 13:36:51 +00:00
Justin Cormack
dd4ee77a23 Use Go code to extract rootfs from system containers
- this removes the use of riddler to extract the rootfs, use code
  we were using for rootfs. riddler now just geenrates the config,
  next stage is to generate this ourselves
- change the naming of the daemons so no longer include number as we
  do not guarantee ordering as they start up simultaneously

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-24 13:05:28 +00:00
Justin Cormack
c33896dcdc Merge pull request #1357 from thebsdbox/vmdk
added the capability to produce a vmdk file through Moby
2017-03-23 11:25:58 +00:00
dan
3fa494cb60 Added the capability to output moby images as vmdk files for use with VMware Workstation/Fusion
Corrected naming from vmware->vmdk and fixed Makfile

Fixed mistake outputting a vhd instead of a vmdk in output.go

Build vmdk image and added to Docker Hub, corrected link in output.go

Modified directories to confirm to standard mkimage-<imgType>

Signed-off-by: Dan Finneran <dan@thebsdbox.co.uk>
2017-03-23 11:16:40 +00:00
Justin Cormack
a2049a0da9 Merge pull request #1370 from justincormack/no-docker2tar
Remove docker2tar docker image, use Docker directly from Go
2017-03-23 09:44:21 +00:00
Justin Cormack
b63d27d405 Remove docker2tar docker image, use Docker directly from Go
Removing the left over indirect creates that use the Docker socket
and run in containers not directly.

See #1347

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-22 22:26:13 +00:00
Rolf Neugebauer
b8af990d62 moby: Log error when the kernel untar fails
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 15:14:17 +00:00
Rolf Neugebauer
d6e50e72d0 moby: Add a 'run' command to execute an image on hyperkit
'moby run' will use the kernel and initrd image produced
by 'moby build' and, on macOS, will run it inside a
hyperkit VM. This assumes that you have a recent version
of Docker for Mac installed as it re-uses the hyperkit
and VPNKit from it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:47:56 +00:00
Rolf Neugebauer
7a6bc781de moby: Introduce the "build" subcommand
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:38:02 +00:00
Rolf Neugebauer
547a3e9380 moby: Factor out build code into a separate source file
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:38:02 +00:00
Justin Cormack
bede7847e3 Move Go code to src/cmd
This does not get everything where we want it finally, see #1266
nor the optimal way of building, but it gets it out of top level.

Added instructions to build if you have a Go installation.

Not moving `vendor` yet.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-21 14:37:23 +00:00
Justin Cormack
3c58702d42 Fix accidental removal of /etc/mtab from images
This was breaking some containers that use it, was a mistake.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-20 23:27:37 +00:00
Justin Cormack
4da9303b17 Output kernel command line to a file in the kernel+initrd output case
Trying to find the relevant yaml file was an issue as we now support
`--name` and it might be in a different directory, so although it is
a bit verbose outputing a whole file at least it is more consistent.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-20 13:43:09 +00:00
Justin Cormack
c4c7c1e8d8 Add a metadata handler for GCP which allows ssh login
- this needs improvements to make it more "platform native", in
  particular GCP supports multiple users and more ssh key mangement
  options.
- at present you can login as root with any platform ssh key
- add support for uts=host and ipc=host
- set the hostname from the metadata as well

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-16 18:45:44 +00:00
Justin Cormack
ee76e8bdfd GCP image handling enhancements
- the `public` option was not previously implemented
- add `replace` only for GCP images which will error otherwise. Only
  recommended for use in development, in production use the `--name` option
  to provide a different name eaxch time. Note only applies to GCP images,
  will document these options properly soon.
- add a `family` option; this allows you to upload many images and the
  user can select the latest using the `family` option instead of a specific
  image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-16 13:20:21 +00:00
Justin Cormack
7149da4b4f Add a --name cli option to the moby tool
This sets the base name of the built images which otherwise
defaults to the basename of your yaml file. This allows
building different versions easily eg adding git sha to the
output names.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-16 11:51:49 +00:00
Justin Cormack
a7d650f5be Merge pull request #1307 from ijc25/isoefi-autosize
tools: Calculate EFI ESP FAT FS size based on contents.
2017-03-15 14:22:20 +00:00
Ian Campbell
728115f0ee tools: Calculate EFI ESP FAT FS size based on contents.
This requires switching to the dosfstools from alpine:edge since neither the
busybox nor alpine:3.5 dosfstools supports the -C option (in fact alpine:3.5
only has mkfs.fat and not mkfs.vfat).

The 511k slack seems like a lot to me, but 256k was somehow not enough.

Fixes #1304.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-03-15 13:30:20 +00:00
Justin Cormack
ee3379290b Add upload to Google Cloud Storage and Google Compute Image creation
- the image upload uses the cloud API
- currently auth and image creation need the `gcloud` CLI tool.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-14 14:45:05 +00:00
Riyaz Faizullabhoy
450e39305b Merge pull request #1290 from riyazdf/ro-system-containers
Add read-only option to containers, apply to all except nginx
2017-03-13 16:23:44 +00:00
Riyaz Faizullabhoy
e8d88ece91 Add read-only option to containers, apply to all except nginx
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-03-13 15:51:03 +00:00
Justin Cormack
7a58dad3a3 Fix typo/copy paste for IPC namespaces
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-13 15:00:22 +00:00
Justin Cormack
40ce7977ae Add qcow2 output support
- outputs compressed qcow2 image
- 1GB underlying size, may need changing

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-10 16:38:37 +00:00
Justin Cormack
64d388d3fe Add VHD and GCE output formats
- VHD is uncompressed VHD. Currently hard coded at 1GB, which may need to change. Use `format: vhd`
- GCE is the GCE compressed tarred raw image. Use `format: gce-img` - reserving `gce` for actually
  uploading the image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-10 16:10:48 +00:00
Tycho Andersen
3fa9192f56 better debugging output in more error cases
Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-03-09 14:29:40 -08:00
Tycho Andersen
183fb49d71 hoist kernel cmdline into moby.yaml
Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-03-09 14:29:40 -08:00
Justin Cormack
befb0bcdec Add in sysctl container
- based on @riyazdf earlier unmerged Go version 891c006d34/alpine/containers/cloud-config/main.go

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-09 14:41:19 +00:00
Tycho Andersen
1cfe28aaa4 better debugging output in some error cases
from:

2017/03/07 09:59:30 Failed to extract kernel image and tarball

to

2017/03/07 10:06:04 Failed to extract kernel image and tarball: Unable to find image 'mobylinux/kernel:7fa748810d7866797fd807a5682d5cb3c9c98111' locally

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-03-07 10:50:12 -08:00
Justin Cormack
3637f0a5bd Out with the old, in with the new Moby
- remove remainder of editions code
- add a new check container to run tests without Docker
- switch over `make test` to use new command to build tests

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-06 22:28:41 +00:00
Justin Cormack
4cf1e1290d Add output types for BIOS and EFI ISOs
Note that the EFI ISO is not yet automatically sized, and the
kernel command lines are currently hard coded in the builders.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-03 18:44:47 -08:00
Justin Cormack
2c789d84d6 Add initial support for specifying the output type
Currently only supports kernel+initrd output but will add the rest
soon.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-03 14:49:47 -08:00
Justin Cormack
890097dc8e Refactoring of Moby tool
- split out config processing a bit
- just use `capabilities` not `cap-add` and `cap-drop`
- allow use of CAP_ prefix on capabilities, as this is what `runc` uses
- add nginx to example config
- fix bind mounts

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-01 15:52:51 -08:00
Justin Cormack
22298c7761 Rough first version of the moby tool
- terrible code
- lots needs changing
- can build a Moby from a config yaml that boots

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-02-20 21:44:23 +00:00
1964 changed files with 133487 additions and 61614 deletions

View File

@@ -3,7 +3,7 @@ jobs:
build:
working_directory: /go/src/github.com/linuxkit/linuxkit
docker:
- image: circleci/golang:1.9-stretch
- image: circleci/golang:1.11-stretch
steps:
- checkout
- run: mkdir -p ./bin
@@ -16,7 +16,7 @@ jobs:
- run:
name: Dependencies
command: |
go get -u github.com/golang/lint/golint
go get -u golang.org/x/lint/golint
go get -u github.com/gordonklaus/ineffassign
- run:
name: Lint

View File

@@ -7,6 +7,7 @@
# For explanation on this file format: man git-shortlog
Alice Frosi <alice@linux.vnet.ibm.com> <alice@linux.vnet.ibm.comx>
Alice Frosi <alice@linux.vnet.ibm.com> <afrosi@de.ibm.com>
Amir Chaudhry <amir.chaudhry@docker.com> <amirmc@gmail.com>
Anil Madhavapeddy <anil.madhavapeddy@docker.com> <anil@recoil.org>
Dan Finneran <dan@thebsdbox.co.uk> <dan@dev.fnnrn.me>
@@ -21,20 +22,25 @@ Dave Tucker <dt@docker.com> <dave@dtucker.co.uk>
David Gageot <david.gageot@docker.com> <david@gageot.net>
David Sheets <david.sheets@docker.com> <dsheets@docker.com>
David Sheets <david.sheets@docker.com> <sheets@alum.mit.edu>
Eric Briand <eric.briand@gmail.com>
Ian Campbell <ian.campbell@docker.com> <ijc25@users.noreply.github.com>
Ian Campbell <ian.campbell@docker.com> <ijc@docker.com>
Ian Campbell <ian.campbell@docker.com> <ijc@users.noreply.github.com>
Ian Campbell <ian.campbell@docker.com> <ijc@lxdeb01.marist.edu>
Isaac Rodman <isaac@eyz.us> <isaac.rodman@healthtrio.com>
Isaac Rodman <isaac@eyz.us>
Istvan Szukacs <l1x@users.noreply.github.com>
James McCoy <james@mcy.email>
Jeff Wu <jeff.wu.junfei@gmail.com> <JeffWuBJ@users.noreply.github.com>
Jeremy Yallop <yallop@docker.com> <yallop@gmail.com>
Justin Cormack <justin.cormack@docker.com> <justin.cormack@unikernel.com>
Justin Cormack <justin.cormack@docker.com> <justin@specialbusservice.com>
Justin Barrick <jbarrick@cloudflare.com>
Ken Cochrane <ken.cochrane@docker.com> <KenCochrane@gmail.com>
Magnus Skjegstad <magnus.skjegstad@docker.com> <magnus@skjegstad.com>
Marten Cassel <marten.cassel@gmail.com> <mcpop28@hotmail.com>
Mindy Preston <mindy.preston@docker.com> <meetup@yomimono.org>
MinJae Kwon <mingrammer@gmail.com>
Nathan Dautenhahn <ndd@seas.upenn.edu> <ndd@cis.upenn.edu>
Nathan LeClaire <nathan.leclaire@docker.com> <nathan.leclaire@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com> <nathanleclaire@gmail.com>
@@ -44,9 +50,10 @@ Radu Matei <matei.radu94@gmail.com>
Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com> <riyazdf@berkeley.edu>
Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com> <riyazdf@gmail.com>
Robin Winkelewski <w9ncontact@gmail.com>
Rolf Neugebauer <rolf.neugebauer@docker.com> <rneugeba@users.noreply.github.com>
Rolf Neugebauer <rolf.neugebauer@docker.com> <rn@users.noreply.github.com>
Rolf Neugebauer <rolf.neugebauer@docker.com> <rolf.neugebauer@gmail.com>
Rolf Neugebauer <rn@rneugeba.io> <rneugeba@users.noreply.github.com>
Rolf Neugebauer <rn@rneugeba.io> <rn@users.noreply.github.com>
Rolf Neugebauer <rn@rneugeba.io> <rolf.neugebauer@gmail.com>
Rolf Neugebauer <rn@rneugeba.io> <rolf.neugebauer@docker.com>
Sebastiaan van Stijn <sebastiaan.vanstijn@docker.com> <github@gone.nl>
Simon Ferquel <simon.ferquel@docker.com> <simon.ferquel@hotmail.fr>
Thomas Gazagnaire <thomas.gazagnaire@docker.com> <thomas@gazagnaire.com>

19
ADOPTERS.md Normal file
View File

@@ -0,0 +1,19 @@
## LinuxKit Adopters
_This list is currently under construction. Please add your use cases to this with a PR. Thanks!_
# Production Users
**_[Docker Desktop](https://www.docker.com/products/docker-desktop)_** - Docker Desktop for Mac and Windows uses LinuxKit to provide an embedded, invisible virtual machine in order to run Linux containers and to run Kubernetes. There are currently millions of active users.
**_[TagHub](https://www.taghub.net)_** - TagHub is a SaaS product for doing asset management. We use LinuxKit to have small and secure linux nodes powering our multi-cloud infrastructure. TagHub is made by [Smart Management](http://www.smartm.no/).
# Projects Using LinuxKit
**_[LinuxKit Nix](https://github.com/nix-community/linuxkit-nix)_** aims to provide a Linux Nix VM for macOS.
**_[cfdev](https://github.com/cloudfoundry-incubator/cfdev)_** A fast and easy local Cloud Foundry experience on native hypervisors, powered by LinuxKit with VPNKit
**_[dm-linuxkit](https://github.com/dotmesh-io/dm-linuxkit)_** A dotmesh controller for LinuxKit persistent storage management.
**_[Zenbuild](https://github.com/zededa/zenbuild)_** Linuxkit based IoT Edge Operating System (Zenix)

31
AUTHORS
View File

@@ -3,13 +3,21 @@
Ajeet Singh Raina, Docker Captain, {Code} Catalysts, Dell EMC R&D <ajeetraina@gmail.com>
Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Alan Raison <alanraison@users.noreply.github.com>
Alex Ellis <alexellis2@gmail.com>
Alex Johnson <hello@alex-johnson.net>
Alexander Slesarev <alex.slesarev@nudatasecurity.com>
Alice Frosi <alice@linux.vnet.ibm.com>
Amir Chaudhry <amir.chaudhry@docker.com>
Anil Madhavapeddy <anil.madhavapeddy@docker.com>
Asbjorn Enge <asbjorn@hanafjedle.net>
Avi Deitcher <avi@deitcher.net>
Ben Allen <bsallen@alcf.anl.gov>
Bill Kerr <bill@generalbill.com>
Brice Figureau <brice-puppet@daysofwonder.com>
Carlton-Semple <carlton.semple@ibm.com>
Chanwit Kaewkasi <chanwit@gmail.com>
Christian Wuerdig <christian.wuerdig@gmail.com>
Craig Ingram <cingram@heroku.com>
Damiano Donati <damiano.donati@gmail.com>
Dan Finneran <dan@thebsdbox.co.uk>
@@ -25,9 +33,11 @@ David Scott <dave.scott@docker.com>
David Sheets <david.sheets@docker.com>
Dennis Chen <dennis.chen@arm.com>
Dieter Reuter <dieter.reuter@me.com>
duraki <duraki@linuxmail.org>
Edward Vielmetti <edward.vielmetti@gmail.com>
Emily Casey <ecasey@pivotal.io>
Eric Briand <eric.briand@gmail.com>
Evan Hazlett <ejhazlett@gmail.com>
French Ben <frenchben@docker.com>
functor <meehow@gmail.com>
Garth Bushell <garth.bushell@oracle.com>
@@ -39,17 +49,23 @@ Ian Campbell <ian.campbell@docker.com>
Ilya Dmitrichenko <errordeveloper@gmail.com>
Isaac Rodman <isaac@eyz.us>
Istvan Szukacs <l1x@users.noreply.github.com>
Ivan Markin <sw@nogoegst.net>
James McCoy <james@mcy.email>
Jason A. Donenfeld <Jason@zx2c4.com>
Jeff Wu <jeff.wu.junfei@gmail.com>
Jeffrey Hogan <jeff.hogan1@gmail.com>
Jeremy Yallop <yallop@docker.com>
Jes Ferrier <jes.ferrier@gmail.com>
Jesse Adametz <jesseadametz@gmail.com>
Johannes Würbach <johannes.wuerbach@googlemail.com>
John Albietz <inthecloud247@gmail.com>
Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Justin Barrick <jbarrick@cloudflare.com>
Justin Cormack <justin.cormack@docker.com>
Justin Ko <justin.ko@oracle.com>
Ken Cochrane <ken.cochrane@docker.com>
Krister Johansen <krister.johansen@oracle.com>
Krisztian Horvath <keyki.kk@gmail.com>
Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Liqdfire <liqdfire@gmail.com>
Lorenzo Fontana <lo@linux.com>
@@ -58,7 +74,9 @@ Madhu Venugopal <madhu@docker.com>
Magnus Skjegstad <magnus.skjegstad@docker.com>
Marco Mariani <marco.mariani@alterway.fr>
Marcus van Dam <marcus@marcusvandam.nl>
Mario Loriedo <mario.loriedo@gmail.com>
marten <marten.cassel@gmail.com>
Mathieu Champlon <mathieu.champlon@docker.com>
Mathieu Pasquet <mathieu.pasquet@alterway.fr>
Matt Bajor <matt.bajor@workday.com>
Matt Bentley <matt.bentley@docker.com>
@@ -66,6 +84,7 @@ Matt Johnson <matjohn2@cisco.com>
Michel Courtine <michel.courtine@docker.com>
Mickaël Salaün <mic@digikod.net>
Mindy Preston <mindy.preston@docker.com>
MinJae Kwon <mingrammer@gmail.com>
Natanael Copa <natanael.copa@docker.com>
Nathan Dautenhahn <ndd@seas.upenn.edu>
Nathan LeClaire <nathan.leclaire@docker.com>
@@ -74,6 +93,8 @@ Niclas Mietz <niclas@mietz.io>
Nico Di Rocco <dirocco.nico@gmail.com>
Olaf Bergner <olaf.bergner@gmx.de>
Olaf Flebbe <of@oflebbe.de>
Omar Ramadan <omar.ramadan93@gmail.com>
Patrik Cyvoct <patrik@ptrk.io>
Phil Estes <estesp@linux.vnet.ibm.com>
Pierre Gayvallet <pierre.gayvallet@docker.com>
Pratik Mallya <mallya@us.ibm.com>
@@ -82,17 +103,21 @@ Richard Mortier <mort@cantab.net>
Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Robb Kistler <robb.kistler@docker.com>
Robin Winkelewski <w9ncontact@gmail.com>
Rolf Neugebauer <rolf.neugebauer@docker.com>
Rolf Neugebauer <rn@rneugeba.io>
Roman Shaposhnik <rvs@zededa.com>
Rui Lopes <rgl@ruilopes.com>
Ryoga Saito <proelbtn@gmail.com>
Scott Coulton <scott.coulton@puppet.com>
Sebastiaan van Stijn <sebastiaan.vanstijn@docker.com>
sethp <seth.pellegrino@gmail.com>
Simarpreet Singh <simar@linux.com>
Simon Ferquel <simon.ferquel@docker.com>
Sotiris Salloumis <sotiris.salloumis@gmail.com>
Steeve Morin <steeve.morin@gmail.com>
Stefan Bourlon <stefan.bourlon@ca.com>
Stephen J Day <stephen.day@docker.com>
Steve Hiehn <shiehn@pivotal.io>
Sukchan Lee <acetcom@gmail.com>
Theo Koulouris <theo.koulouris@hpe.com>
Thomas Conte <thomas@conte.com>
Thomas Gazagnaire <thomas.gazagnaire@docker.com>
@@ -101,8 +126,12 @@ Thomas Shaw <tomwillfixit@users.noreply.github.com>
Tiago Pires <tandrepires@gmail.com>
Tiejun Chen <tiejun.china@gmail.com>
Tim Potter <tpot@hpe.com>
Tobias Gesellchen <tobias@gesellix.de>
Tobias Klauser <tklauser@distanz.ch>
Tomas Knappek <tomas.knappek@gmail.com>
Tristan Slominski <tristan.slominski@gmail.com>
Tycho Andersen <tycho@docker.com>
Vincent Demeester <Vincent.Demeester@docker.com>
Zachery Hostens <zacheryph@gmail.com>
zimbatm <zimbatm@zimbatm.com>
zlim <zlim.lnx@gmail.com>

View File

@@ -3,6 +3,67 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [v0.7] - 2019-04-17
### Added
- Reproducible `linuxkit build` for some output formats
- Support uncompressed kernels, e.g., for crosvm and firecracker.
- Support encrypted disks via `dm-crypt`
- New `bpftrace` package
- Support for USB devices in `qemu`
### Changed
- Alpine base updated to 3.9
- `containerd` updated to v1.2.6
- WireGuard updated to 0.0.20190227
- Updated Docker base API level
- VirtualBox improvements (multiple drives and network adapters)
- Fixed Windows path handling in `linuxkit`
- GCP: Improve error checking/handling
### Removed
## [v0.6] - 2018-07-26
### Added
- `linuxkit build` now works with private repositories and registries.
- `linuxkit pkg build` can build packages with sources outside the package directory.
- New `kernel+iso` format for `linuxkit build`.
### Changed
- `containerd` updated to v1.1.2.
- WireGuard updated to 0.0.20180718.
- Fixed SSH key handling on GCP.
- Changed name of logfiles when memlogd/logwrite is used.
- `moby/tool` code merged back into `linuxkit/linuxkit`
- Smaller `mkimage-*` packages.
### Removed
## [v0.5] - 2018-07-10
### Added
- New logging support with log rotation.
- Scaleway provider.
- Support for v4.17.x kernels.
- Kernel source are now included in the kernel packages.
- Improved documentation about debugging LinuxKit.
### Changed
- Switched to Alpine Linux 3.8 as the base.
- `containerd` updated to v1.1.1.
- `pkg/cadvisor` updated to v0.30.2
- `pkg/node_exporter` updated to 0.16.0
- WireGuard updated to 0.0.20180708.
- Linux firmware binaries update to latest.
- Improved support for building on Windows.
- Improved support for AWS/GCP metadata.
- Better handling of reboot/poweroff.
### Removed
- Support for v4.16.x. kernels as they have been EOLed.
## [v0.4] - 2018-05-12
### Added
- Support for v4.16.x kernels.

View File

@@ -195,5 +195,5 @@ on disputes for technical matters."
[people.rn]
Name = "Rolf Neugebauer"
Email = "rolf.neugebauer@docker.com"
Email = "rn@rneugeba.io"
GitHub = "rn"

View File

@@ -1,16 +1,17 @@
.DELETE_ON_ERROR:
.PHONY: default all
default: bin/linuxkit bin/rtf
all: default
VERSION="v0.4"
VERSION="v0.7"
GIT_COMMIT=$(shell git rev-list -1 HEAD)
GO_COMPILE=linuxkit/go-compile:a8bffe875268a973ea82e5937b0fb23a5b08cc79
GO_COMPILE=linuxkit/go-compile:8de0e27a38498389e43b3a5b520d943a2b3be5ba
ifeq ($(OS),Windows_NT)
LINUXKIT?=bin/linuxkit.exe
RTF?=bin/rtf.exe
GOOS?=windows
else
LINUXKIT?=bin/linuxkit
RTF?=bin/rtf
GOOS?=$(shell uname -s | tr '[:upper:]' '[:lower:]')
endif
GOARCH?=amd64
ifneq ($(GOOS),linux)
CROSS+=-e GOOS=$(GOOS)
@@ -21,16 +22,22 @@ endif
PREFIX?=/usr/local/
.DELETE_ON_ERROR:
.PHONY: default all
default: $(LINUXKIT) $(RTF)
all: default
RTF_COMMIT=171155c375706f2616f0b9c96afe2240e15d1de1
RTF_CMD=github.com/linuxkit/rtf/cmd
RTF_VERSION=0.0
bin/rtf: tmp_rtf_bin.tar | bin
$(RTF): tmp_rtf_bin.tar | bin
tar xf $<
rm $<
touch $@
tmp_rtf_bin.tar: Makefile
docker run --rm --log-driver=none -e http_proxy=$(http_proxy) -e https_proxy=$(https_proxy) $(CROSS) $(GO_COMPILE) --clone-path github.com/linuxkit/rtf --clone https://github.com/linuxkit/rtf.git --commit $(RTF_COMMIT) --package github.com/linuxkit/rtf --ldflags "-X $(RTF_CMD).GitCommit=$(RTF_COMMIT) -X $(RTF_CMD).Version=$(RTF_VERSION)" -o bin/rtf > $@
docker run --rm --log-driver=none -e http_proxy=$(http_proxy) -e https_proxy=$(https_proxy) $(CROSS) $(GO_COMPILE) --clone-path github.com/linuxkit/rtf --clone https://github.com/linuxkit/rtf.git --commit $(RTF_COMMIT) --package github.com/linuxkit/rtf --ldflags "-X $(RTF_CMD).GitCommit=$(RTF_COMMIT) -X $(RTF_CMD).Version=$(RTF_VERSION)" -o $(RTF) > $@
# Manifest tool for multi-arch images
MT_COMMIT=bfbd11963b8e0eb5f6e400afaebeaf39820b4e90
@@ -44,13 +51,13 @@ tmp_mt_bin.tar: Makefile
docker run --rm --log-driver=none -e http_proxy=$(http_proxy) -e https_proxy=$(https_proxy) $(CROSS) $(GO_COMPILE) --clone-path github.com/estesp/manifest-tool --clone $(MT_REPO) --commit $(MT_COMMIT) --package github.com/estesp/manifest-tool --ldflags "-X main.gitCommit=$(MT_COMMIT)" -o bin/manifest-tool > $@
LINUXKIT_DEPS=$(wildcard src/cmd/linuxkit/*.go) $(wildcard src/cmd/linuxkit/*/*.go) Makefile src/cmd/linuxkit/vendor.conf
bin/linuxkit: tmp_linuxkit_bin.tar
$(LINUXKIT): tmp_linuxkit_bin.tar
tar xf $<
rm $<
touch $@
tmp_linuxkit_bin.tar: $(LINUXKIT_DEPS)
tar cf - -C src/cmd/linuxkit . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)" -o bin/linuxkit > $@
tar cf - -C src/cmd/linuxkit . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)" -o $(LINUXKIT) > $@
.PHONY: test-cross
test-cross:
@@ -63,7 +70,7 @@ test-cross:
$(MAKE) clean
LOCAL_LDFLAGS += -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)
LOCAL_TARGET ?= bin/linuxkit
LOCAL_TARGET ?= $(LINUXKIT)
.PHONY: local-check local-build local-test local-static-pie local-static local-dynamic local
local-check: $(LINUXKIT_DEPS)

View File

@@ -10,12 +10,13 @@ LinuxKit, a toolkit for building custom minimal, immutable Linux distributions.
- Completely stateless, but persistent storage can be attached
- Easy tooling, with easy iteration
- Built with containers, for running containers
- Designed to create [reproducible builds](./docs/reproducible-builds.md) [WIP]
- Designed for building and running clustered applications, including but not limited to container orchestration such as Docker or Kubernetes
- Designed from the experience of building Docker Editions, but redesigned as a general-purpose toolkit
- Designed to be managed by external tooling, such as [Infrakit](https://github.com/docker/infrakit) or similar tools
- Includes a set of longer-term collaborative projects in various stages of development to innovate on kernel and userspace changes, particularly around security
LinuxKit currently supports the `x86_64`, `arm64`, and `s390x` architectures on a variety of platforms, both as virtual machines and baremetal (see [below](#booting-and-testing) for details.
LinuxKit currently supports the `x86_64`, `arm64`, and `s390x` architectures on a variety of platforms, both as virtual machines and baremetal (see [below](#booting-and-testing) for details).
## Subprojects
@@ -24,6 +25,7 @@ LinuxKit currently supports the `x86_64`, `arm64`, and `s390x` architectures on
- [linux](https://github.com/linuxkit/linux) A copy of the Linux stable tree with branches LinuxKit kernels.
- [virtsock](https://github.com/linuxkit/virtsock) A `go` library and test utilities for `virtio` and Hyper-V sockets.
- [rtf](https://github.com/linuxkit/rtf) A regression test framework used for the LinuxKit CI tests (and other projects).
- [homebrew](https://github.com/linuxkit/homebrew-linuxkit) Homebrew packages for the `linuxkit` tool.
## Getting Started
@@ -58,8 +60,6 @@ linuxkit build linuxkit.yml
to build the example configuration. You can also specify different output formats, eg `linuxkit build -format raw-bios linuxkit.yml` to
output a raw BIOS bootable disk image, or `linuxkit build -format iso-efi linuxkit.yml` to output an EFI bootable ISO image. See `linuxkit build -help` for more information.
Since `linuxkit build` is built around the [Moby tool](https://github.com/moby/tool) the input yml files are described in the [Moby tool documentation](https://github.com/moby/tool/blob/master/docs/yaml.md).
### Booting and Testing
You can use `linuxkit run <name>` or `linuxkit run <name>.<format>` to
@@ -117,7 +117,7 @@ To customise, copy or modify the [`linuxkit.yml`](linuxkit.yml) to your own `fil
generate its specified output. You can run the output with `linuxkit run file`.
The yaml file specifies a kernel and base init system, a set of containers that are built into the generated image and started at boot time. You can specify the type
of artifact to build with the `moby` tool eg `linuxkit build -format vhd linuxkit.yml`.
of artifact to build eg `linuxkit build -format vhd linuxkit.yml`.
If you want to build your own packages, see this [document](docs/packages.md).
@@ -131,7 +131,7 @@ The yaml format specifies the image to be built:
- `services` is the system services, which normally run for the whole time the system is up
- `files` are additional files to add to the image
For a more detailed overview of the options see [yaml documentation](https://github.com/moby/tool/blob/master/docs/yaml.md)
For a more detailed overview of the options see [yaml documentation](docs/yaml.md)
## Architecture and security
@@ -156,7 +156,11 @@ This is an open project without fixed judgements, open to the community to set t
## Development reports
There are weekly [development reports](reports/) summarizing work carried out in the week.
There are monthly [development reports](reports/) summarising the work carried out each month.
## Adopters
We maintain an incomplete list of [adopters](ADOPTERS.md). Please open a PR if you are using LinuxKit in production or in your project, or both.
## FAQ

View File

@@ -1,7 +1,7 @@
FROM rust:1.25.0-stretch
FROM rust:1.30.0-stretch
ENV CROSVM_REPO=https://chromium.googlesource.com/chromiumos/platform/crosvm
ENV CROSVM_COMMIT=7a7268faf0a43c79b6a4520f5c2f35c3e0233932
ENV CROSVM_COMMIT=c527c1a7e8136dae1e8ae728dfd9932bf3967e7e
ENV MINIJAIL_REPO=https://android.googlesource.com/platform/external/minijail
ENV MINIJAIL_COMMIT=d45fc420bb8fd9d1fc9297174f3c344db8c20bbd

View File

@@ -25,56 +25,30 @@ You may also have to create an empty directory `/var/empty`.
## Use with LinuxKit images
You can build a LinuxKit image suitable for `crosvm` with the
`kernel+squashfs` build format. For example, using this LinuxKit
YAML file (`minimal.yml`):
```
kernel:
image: linuxkit/kernel:4.9.91
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
services:
- name: getty
image: linuxkit/getty:v0.4
env:
- INSECURE=true
trust:
org:
- linuxkit
```
run:
`kernel+squashfs` build format. For example, using `minimal.yml` from
the `./examples` directory, run (but also see the known issues):
```sh
linuxkit build -output kernel+squashfs minimal.yml
linuxkit build -format kernel+squashfs -decompress-kernel minimal.yml
```
The kernel this produces (`minimal-kernel`) needs to be converted as
`crosvm` does not grok `bzImage`s. You can convert the LinuxKit kernel
image with
[extract-vmlinux](https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux):
```sh
extract-vmlinux minimal-kernel > minimal-vmlinux
```
The `-vmlinux` switch is needed since `crosvm` does not grok
compressed linux kernel images.
Then you can run `crosvm`:
```sh
./crosvm run --seccomp-policy-dir=./seccomp/x86_64 \
crosvm run --disable-sandbox \
--root ./minimal-squashfs.img \
--mem 2048 \
--multiprocess \
--socket ./linuxkit-socket \
minimal-vmlinux
minimal-kernel
```
## Known issues
- With 4.14.x, a `BUG_ON()` is hit in `drivers/base/driver.c`. 4.9.x
kernels seem to work.
- With the latest version, I don't seem to get a interactive console.
- Networking does not yet work, so don't include a `onboot` `dhcpd` service.
- `poweroff` from the command line does not work (crosvm does not seem
to support ACPI). So to stop a VM you can use the control socket

View File

@@ -1,4 +1,4 @@
FROM alpine:3.7 AS extract
FROM alpine:3.8 AS extract
ARG DEB_URLS

View File

@@ -1,4 +1,4 @@
FROM alpine:3.7 AS extract
FROM alpine:3.8 AS extract
ARG RPM_URLS

86
docs/encrypted-disk.md Normal file
View File

@@ -0,0 +1,86 @@
# Device encryption with dm-crypt
In the packages section you can find an image to setup dm-crypt encrypted devices in [linuxkit](https://github.com/linuxkit/linuxkit)-generated images.
## Usage
The setup is a one time step during boot:
```yaml
onboot:
- name: dm-crypt
image: linuxkit/dm-crypt:<hash>
command: ["/usr/bin/crypto", "dm_crypt_name", "/dev/sda1"]
- name: mount
image: linuxkit/mount:<hash>
command: ["/usr/bin/mountie", "/dev/mapper/dm_crypt_name", "/var/secure_storage"]
files:
- path: etc/dm-crypt/key
contents: "abcdefghijklmnopqrstuvwxyz123456"
```
The above will map `/dev/sda1` as an encrypted device under `/dev/mapper/dm_crypt_name` and mount it under `/var/secure_storage`
The `dm-crypt` container by default bind-mounts `/dev:/dev` and `/etc/dm-crypt:/etc/dm-crypt`. It expects the encryption key to be present in the file `/etc/dm-crypt/key`. You can pass an alternative location as encryption key which can be either a file path relative to `/etc/dm-crypt` or an absolute path.
Providing an alternative encryption key file name:
```yaml
onboot:
- name: dm-crypt
image: linuxkit/dm-crypt:<hash>
command: ["/usr/bin/crypto", "-k", "some_other_key", "dm_crypt_name", "/dev/sda1"]
- name: mount
image: linuxkit/mount:<hash>
command: ["/usr/bin/mountie", "/dev/mapper/dm_crypt_name", "/var/secure_storage"]
files:
- path: etc/dm-crypt/some_other_key
contents: "abcdefghijklmnopqrstuvwxyz123456"
```
Providing an alternative encryption key file name as absolute path:
```yaml
onboot:
- name: dm-crypt
image: linuxkit/dm-crypt:<hash>
command: ["/usr/bin/crypto", "-k", "/some/other/key", "dm_crypt_name", "/dev/sda1"]
binds:
- /dev:/dev
- /etc/dm-crypt/some_other_key:/some/other/key
- name: mount
image: linuxkit/mount:<hash>
command: ["/usr/bin/mountie", "/dev/mapper/dm_crypt_name", "/var/secure_storage"]
files:
- path: etc/dm-crypt/some_other_key
contents: "abcdefghijklmnopqrstuvwxyz123456"
```
Note that you have to also map `/dev:/dev` explicitly if you override the default bind-mounts.
The `dm-crypt` container
* Will create an `ext4` file system on the encrypted device if none is present.
* It will also initialize the encrypted device by filling it from `/dev/zero` prior to creating the filesystem. Which means if the device is being setup for the first time it might take a bit longer.
* Uses the `aes-cbc-essiv:sha256` cipher (it's explicitly specified in case the default ever changes)
* Consequently the encryption key is expected to be 32 bytes long, a random one can be created via
```shell
dd if=/dev/urandom of=dm-crypt.key bs=32 count=1
```
If you see the error `Cannot read requested amount of data.` next to the log message `Creating dm-crypt mapping for ...` then this means your keyfile doesn't contain enough data.
### Examples
There are two examples in the `examples/` folder:
1. `dm-crypt.yml` - formats an external disk and mounts it encrypted.
2. `dm-crypt-loop.yml` - mounts an encrypted loop device backed by a regular file sitting on an external disk
### Options
|Option|Default|Required|Notes|
|---|---|---|---|
|`-k` or `--key`|`key`|No|Encryption key file name. Must be either relative to `/etc/dm-crypt` or an absolute file path.|
|`-l` or `--luks`||No|Use LUKS format for encryption|
|`<dm_name>`||**Yes**|The device-mapper device name to use. The device will be mapped under `/dev/mapper/<dm_name>`|
|`<device>`||**Yes**|Device to encrypt.|

View File

@@ -30,3 +30,49 @@ of dependencies and functionality that we do not need. At present we are using t
`init` process, and a small set of minimal scripts, but we expect to replace that with a small
standalone `init` process and a small piece of code to bring up the system containers where the
real work takes place.
## Console not displaying init or containerd output at boot
If you're not seeing `containerd` logs in the console during boot, make sure that your kernel `cmdline` configuration doesn't list multiple consoles.
`init` and other processes like `containerd` will use the last defined console in the kernel `cmdline`. When using `qemu`, to see the console you need to list `ttyS0` as the last console to properly see the output.
## Troubleshooting containers
Linuxkit runs all services in a specific `containerd` namespace called `services.linuxkit`. To list all the defined containers:
```sh
(ns: getty) linuxkit-befde23bc535:~# ctr -n services.linuxkit container ls
CONTAINER IMAGE RUNTIME
getty - io.containerd.runtime.v1.linux
```
To list all running containers and their status:
```sh
(ns: getty) linuxkit-befde23bc535:~# ctr -n services.linuxkit task ls
TASK PID STATUS
getty 661 RUNNING
```
To list all processes running in a container:
```sh
(ns: getty) linuxkit-befde23bc535:/containers/services/getty# ctr -n services.linuxkit task ps getty
PID INFO
661 &ProcessDetails{ExecID:getty,}
677 -
685 -
686 -
687 -
1237 -
```
To attach a shell to a running container:
```sh
(ns: getty) linuxkit-befde23bc535:/containers/services/getty# ctr -n services.linuxkit tasks exec --tty --exec-id sh sshd /bin/ash -l
(ns: sshd) linuxkit-befde23bc535:/#
```
Containers are defined as OCI bundles in `/containers`.

31
docs/kernel-bcc.md Normal file
View File

@@ -0,0 +1,31 @@
# Using the bcc utility with LinuxKit
The `bcc` utility is a standard Linux tool to access performance
counters, trace events and access various other kernel internals for
performance analysis.
The `bcc` utility needs to matched be with the kernel. For recent
kernel build, LinuxKit provides a `linuxkit/kernel-bcc` package with
a matching tag for each kernel under `linuxkit/kernel`.
The preferred way of using the `linuxkit/kernel-bcc` package is to
add it to the `init` section. This adds `/usr/share/bcc` to the
systems' root filesystem. From there it can be
- bind mounted into your container
- accessed via `/proc/1/root/usr/share/bcc/tools` from with in the `getty`
or `ssh` container.
- accessed via a nsenter of `/bin/ash` of proc 1.
If you want to use `bcc` you may also want to remove the `sysctl`
container, or alternatively, disable the kernel pointer restriction it
enables by default:
```
echo 0 > /proc/sys/kernel/kptr_restrict
```
Now, `bcc` is ready to use. The LinuxKit `bcc` package contains
the `bcc` binary, example and tool scripts, and kernel headers for the
associated kernel build.

View File

@@ -54,7 +54,7 @@ the specific version of the kernel. Currently, the headers are not
included in the initial RAM disk, but it is possible to compile custom
modules offline and then include the modules in the initial RAM disk.
There is a [example](../test/cases/020_kernel/010_kmod_4.9.x), but
There is a [example](../test/cases/020_kernel/011_kmod_4.9.x), but
basically one can use a multi-stage build to compile the kernel
modules:

94
docs/logging.md Normal file
View File

@@ -0,0 +1,94 @@
# Logging
By default LinuxKit will write onboot and service logs directly to files in
`/var/log` and `/var/log/onboot`.
It is tricky to write the logs to a disk or a network service as no disks
or networks are available until the `onboot` containers run. We work around
this by splitting the logging into 2 pieces:
1. `memlogd`: an in-memory circular buffer which receives logs (including
all the early `onboot` logs)
2. a log writing `service` that starts later and can download and process
the logs from `memlogd`
To use this new logging system, you should add the `memlogd` container to
the `init` block in the LinuxKit yml. On boot `memlogd` will be started
from `init.d` and it will listen on a Unix domain socket:
```
/var/run/linuxkit-external-logging.sock
```
The `init`/`service` process will look for this socket and redirect the
`stdout` and `stderr` of both `onboot` and `services` to `memlogd`.
## memlogd: an in-memory circular buffer
The `memlogd` daemon reads the logs from the `onboot` and `services` containers
and stores them together with a timestamp and the name of the originating
container in a circular buffer in memory.
The contents of the circular buffer can be read over the Unix domain socket
```
/var/run/memlogq.sock
```
The circular buffer has a fixed size (overridden by the command-line argument
`-max-lines`) and when it fills up, the oldest messages will be overwritten.
To store the logs somewhere more permanent, for example a disk or a remote
network service, a service should be added to the yaml which connects to
`memlogd` and streams the logs. The `logwrite` service described below shows
how to do this.
### Message format
The format used to read logs is similar to [kmsg](https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg):
```
<timestamp>,<log>;<body>
```
where `<timestamp>` is an RFC3339-formatted timestamp, `<log>` is the name of
the log (e.g. `docker-ce.out`) and `<body>` is the output. The `<log>` must
not contain the character `;`.
## logwrite: writing logs to disk
The service `pkg/logwrite` connects to `memlogd` and streams the logs to files
in `/var/log`. The logs are automatically rotated; by default each file has
a maximum size of 1 MiB and up to 10 files are kept per log. The arguments
`-max-log-files` and `-max-log-size` can be used to override these defaults.
Here is an example log file:
```
# cat /var/log/onboot.001-dhcpcd.out
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: waiting for carrier
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: carrier acquired
2018-07-08T09:16:53Z onboot.001-dhcpcd.out DUID 00:01:00:01:22:d4:93:05:02:50:00
:00:00:06
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: IAID 00:00:00:06
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: adding address fe80::f346:56a6:590d:5ea4
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: soliciting an IPv6 router
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: soliciting a DHCP lease
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: offered 192.168.65.8 from 192.168.65.1 `vpnkit'
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: leased 192.168.65.8 for 7200 se
conds
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: adding route to 192.168.65.0/24
2018-07-08T09:16:53Z onboot.001-dhcpcd.out eth0: adding default route via 192.16
8.65.1
2018-07-08T09:16:53Z onboot.001-dhcpcd.out exiting due to oneshot
2018-07-08T09:16:53Z onboot.001-dhcpcd.out dhcpcd exited
```
## Current issues and limitations:
- No docker logger plugin support yet - it could be nice to add support to
memlogd, so the docker container logs would also be gathered in one place
- No syslog compatibility at the moment and `/dev/log` doesnt exist. This
socket could be created to keep syslog compatibility, e.g. by using
https://github.com/mcuadros/go-syslog. Processes that require syslog should
then be able to log directly to memlogd.
- Currently no direct external hooks exposed - but options available that
could be added. Should also be possible to pipe output to e.g. `oklog`
from `logread` (https://github.com/oklog/oklog)

27
docs/losetup.md Normal file
View File

@@ -0,0 +1,27 @@
# LinuxKit losetup
Image to setup a loop device backed by a regular file in a [linuxkit](https://github.com/linuxkit/linuxkit)-generated image. The typical use case is to have a portable storage location which can be used to persist settings or other files. Can be combined with the `linuxkit/dm-crypt` package for protection.
## Usage
The setup is a one time step during boot:
```yaml
onboot:
- name: losetup
image: linuxkit/losetup:<hash>
command: ["/usr/bin/loopy", "-c", "/var/test.img"]
```
The above will associate the file `/var/test.img` with `/dev/loop0` and will also create it if it's not present.
The container by default bind-mounts `/var:/var` and `/dev:/dev`. Usually the loop-file will reside on external storage which should be typically mounted under `/var` hence the choice of the defaults. If the loop-file is located somewhere else and you need a different bind-mount for it then do not forget to explicitly bind-mount `/dev:/dev` as well or else `losetup` will fail.
### Options
|Option|Default|Required|Notes|
|---|---|---|---|
|`-c` or `--create`||No|Creates the file if not present. If `--create` is not specified and the file is missing then the loop setup will obviously fail.|
|`-s` or `--size`|10|No|If `--create` was specified and the file is not present then this sets the size in MiB of the created file. The file will be filled from `/dev/zero`.|
|`-d` or `--dev`|`/dev/loop0`|No|Loop device which should be associated with the file.|
|`<file>`||**Yes**|The file to use as backing storage.|

View File

@@ -37,6 +37,7 @@ A package source consists of a directory containing at least two files:
- `image` _(string)_: *(mandatory)* The name of the image to build
- `org` _(string)_: The hub/registry organisation to which this package belongs
- `arches` _(list of string)_: The architectures which this package should be built for (valid entries are `GOARCH` names)
- `extra-sources` _(list of strings)_: Additional sources for the package outside the package directory. The format is `src:dst`, where `src` can be relative to the package directory and `dst` is the destination in the build context. This is useful for sharing files, such as vendored go code, between packages.
- `gitrepo` _(string)_: The git repository where the package source is kept.
- `network` _(bool)_: Allow network access during the package build (default: no)
- `disable-content-trust` _(bool)_: Disable Docker content trust for this package (default: no)

62
docs/platform-scaleway.md Normal file
View File

@@ -0,0 +1,62 @@
# Using LinuxKit on Scaleway
This is a quick guide to run LinuxKit on Scaleway (only VPS x86_64 for now)
## Setup
Before you proceed it's recommanded that you set up the [Scaleway CLI](https://github.com/scaleway/scaleway-cli/)
and perform an `scw login`. This will create a `$HOME/.scwrc` file containing the required API token.
You can also use the `SCW_TOKEN` environment variable to set a Scaleway token.
The `-token` flag of the `linuxkit push scaleway` and `linuxkit run scaleway` can also be used.
The environment variable `SCW_TARGET_REGION` is used to set the region (there is also the `-region` flag)
## Build an image
Scaleway requires a `iso-efi` image. To create one:
```
$ linuxkit build -format iso-efi examples/scaleway.yml
```
### Changes needed in the yaml
* You have to set `root=/dev/vda` in the `cmdline` to have the right device set on boot
* The metadata package is not only used to set the metadata, but also to signal Scaleway that the instance has booted. So it is encouraged to use it (dhcpcd must be set before)
## Push image
You have to do `linuxkit push scaleway scaleway.iso` to upload it to your Scaleway images.
By default the image name is the name of the ISO file without the extension.
It can be overidden with the `-img-name` flag or the `SCW_IMAGE_NAME` environment variable.
**Note 1:** If an image (and snapshot) of the same name exists, it will be replaced.
**Note 2:** The image is region specific: if you create an image in `par1` you can't use is in `ams1`.
### Push process
Building a Scaleway image have a special process. Basically:
* Create an `image-builder` instance with an additional volume, based on Ubuntu Xenial (only x86_64 for now)
* Copy the ISO image on this instance
* Use `dd` to write the image on the additional volume (`/dev/vdb` by default)
* Terminate the instance, create a snapshot, and create an image from the snapshot
**Note 1:** An image is linked to a snapshot, so you can't delete a snapshot before the image.
**Note 2:** You can specify an already running instance to act as the image builder with the `-instance-id` flag. But if you don't specify the `-no-clean` flag it will be destroyed upon completion.
## Create an instance and connect to it
With the image created, we can now create an instance.
```
linuxkit run scaleway scaleway
```
By default, the instance name is `linuxkit`. It can be overidden with the `-instance-name` flag.
If you don't set the `-no-attach` flag, you will be connected to the serial port.
You can edit the Scaleway example to allow you to SSH to your instance in order to use it.

View File

@@ -20,11 +20,20 @@ stdio, providing interactive access to the VM.
## Disks
The Virtualbox backend support configuring a persistent disk using the
standard `linuxkit` `-disk` syntax. Multiple disks are
standard `linuxkit` `-disk` syntax. Multiple disks are
supported and can be created in `raw` format; other formats that VirtualBox
supports can be attached
supports can be attached. Note that additional drives are attached to the
SATA Controller, unlike the VM disk which is on the IDE Controller.
## Networking
You can select the networking mode, which defaults to the standard `nat`, but
some networking modes may require additional configuration.
You can select the networking mode, which defaults to the standard `nat`, by using the
`-networking` command-line option. Some networking modes (`hostonly`, `bridge`) will require
the additional `adapter` parameter to the `-networking` option:
~~~
-networking hostonly,adapter=vboxnet0
~~~
You can specify more than one `-networking` option to setup multiple adapters. It is
recommended to setup the first adapter as `nat`.

279
docs/releasing.md Normal file
View File

@@ -0,0 +1,279 @@
# Making a LinuxKit release
This document describes the steps to make a LinuxKit release. A
LinuxKit release consists of:
- A git tag of the form vX.Y on a specific commit.
- Packages on Docker hub, tagged with the release tag.
- All sample `YAML` files updated to use the release packages
- `linuxkit` binaries for all supported architectures.
- Changelog entry
Note, we explicitly do not tag kernel images with LinuxKit release
tags as we encourage users to stay current with the kernel
releases. We also do not tag test and `mkimage` packages as these are
not end-user facing.
## Pre-requisites
Releases can be done by any maintainer. Maintainers need to have
access to build machines for all architectures support by LinuxKit and
signing keys set up to sign Docker hub images.
## Release preparation
The release preparation is by far the most time consuming task as it
involves updating all packages and YAML files.
The release preparation is performed on a branch of your up-to-date
LinuxKit clone. This document assumes that your clone of the LinuxKit
repository is available as the `origin` remote in your local `git`
clone (in my setup the official LinuxKit repository is available as
`upstream` remote). If your setup is different, you may have to adjust
some of the commands below.
As a starting point you have to be on the update to date master branch
and be in the root directory of your local git clone. You should also
have the same setup on all build machines used.
To make the release steps below cut-and-pastable, define the following
environment variables:
```sh
LK_RELEASE=v0.4
LK_ROOT=$(pwd)
LK_REMOTE=origin
```
On one of the build machines (preferably the `x86_64` machine), create
the release branch:
```sh
git checkout -b rel_$LK_RELEASE
```
Also make sure that you have a recent version of the `linuxkit`
utility in the path. Either a previous release or compiled from
master.
### Update `linuxkit/alpine`
This step is not necessarily required if the alpine base image has
recently been updated, but it is good to pick up any recent bug
fixes. Updating the alpine base image is different to other packages
and it must be performed on `x86_64` first:
```sh
cd $LK_ROOT/tools/alpine
make push
```
This will update `linuxkit/alpine` and change the `versions.x86_64`
file. Check it in and push to GitHub:
```sh
git commit -a -s -m "tools/alpine: Update to latest"
git push $LK_REMOTE rel_$LK_RELEASE
```
Now, on each build machine for the other supported architectures, in turn:
```sh
git fetch
git checkout rel_$LK_RELEASE
cd $LK_ROOT/tools/alpine
make push
git commit -a --amend
git push --force $LK_REMOTE rel_$LK_RELEASE
```
With all supported architectures updated, head back to the `x86_64`
machine and update the release branch:
```sh
git fetch && git reset --hard $LK_REMOTE/rel_$LK_RELEASE
```
Stash the tag of the alpine base image in an environment variable:
```sh
LK_ALPINE=$(head -1 alpine/versions.x86_64 | sed 's,[#| ]*,,' | sed 's,\-.*$,,' | cut -d':' -f2)
```
### Update tools packages
On the `x86_64` machine, get the `linuxkit/alpine` tag and update the
other packages:
```sh
cd $LK_ROOT/tools
../scripts/update-component-sha.sh --image linuxkit/alpine:$LK_ALPINE
git checkout alpine/versions.aarch64 alpine/versions.s390x
git commit -a -s -m "tools: Update to the latest linuxkit/alpine"
git push $LK_REMOTE rel_$LK_RELEASE
make forcepush
```
Note, the `git checkout` reverts the changes made by
`update-component-sha.sh` to files which are accidentally updated and
the `make forcepush` will skip building the alpine base.
Then, on the other build machines in turn:
```sh
cd $LK_ROOT/tools
git fetch && git reset --hard $LK_REMOTE/rel_$LK_RELEASE
make forcepush
```
Back on the `x86_64` machine:
```sh
cd $LK_ROOT
for img in $(cd tools; make show-tag); do
./scripts/update-component-sha.sh --image $img
done
git commit -a -s -m "Update use of tools to latest"
```
### Update test packages
Next, we update the test packages to the updated alpine base on the `x86_64` system:
```sh
cd $LK_ROOT/test/pkg
../../scripts/update-component-sha.sh --image linuxkit/alpine:$LK_ALPINE
git commit -a -s -m "tests: Update packages to the latest linuxkit/alpine"
git push $LK_REMOTE rel_$LK_RELEASE
make push
```
Then, on the other build machines in turn:
```sh
cd $LK_ROOT/test/pkg
git fetch && git reset --hard $LK_REMOTE/rel_$LK_RELEASE
make push
```
Back on the `x86_64` machine:
```sh
cd $LK_ROOT
for img in $(cd test/pkg; make show-tag); do
./scripts/update-component-sha.sh --image $img
done
git commit -a -s -m "Update use of test packages to latest"
```
Some tests also use `linuxkit/alpine`. Update them as well:
```sh
cd $LK_ROOT/test/cases
../../scripts/update-component-sha.sh --image linuxkit/alpine:$LK_ALPINE
git commit -a -s -m "tests: Update tests cases to the latest linuxkit/alpine"
```
### Update packages
Next, we update the LinuxKit packages. This is really the core of the
release. The other steps above are just there to ensure consistency
across packages.
```sh
cd $LK_ROOT/pkg
../scripts/update-component-sha.sh --image linuxkit/alpine:$LK_ALPINE
git commit -a -s -m "pkgs: Update packages to the latest linuxkit/alpine"
git push $LK_REMOTE rel_$LK_RELEASE
```
Most of the packages are build from `linuxkit/alpine` and source code
in the `linuxkit` repository, but some packages wrap external
tools. The time of a release is a good opportunity to check if there
have been updates. Specifically:
- `pkg/cadvisor`: Check for [new releases](https://github.com/google/cadvisor/releases).
- `pkg/firmware` and `pkg/firmware-all`: Use latest commit from [here](https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git).
- `pkg/node_exporter`: Check for [new releases](https://github.com/prometheus/node_exporter/releases).
- Check [docker hub](https://hub.docker.com/r/library/docker/tags/) for the latest `dind` tags. and update `examples/docker.yml`, `examples/docker-for-mac.yml`, `examples/cadvisor.yml`, and `test/cases/030_security/000_docker-bench/test.yml` if necessary.
The build/push the packages:
```sh
cd $LK_ROOT/pkg
make OPTIONS="-release $LK_RELEASE" push
```
Note, the `OPTIONS` argument. This adds the release tag to the
packages.
Then, on the other build machines in turn:
```sh
cd $LK_ROOT/pkg
git fetch && git reset --hard $LK_REMOTE/rel_$LK_RELEASE
make OPTIONS="-release $LK_RELEASE" push
```
Update the package tags in the YAML files:
```sh
cd $LK_ROOT
for img in $(cd pkg; make show-tag | cut -d ':' -f1); do
./scripts/update-component-sha.sh --image $img:$LK_RELEASE
done
git commit -a -s -m "Update package tags to $LK_RELEASE"
```
### Final preparation steps
- Update AUTHORS by running `./scripts/generate-authors.sh`
- Update the `VERSION` variable in the top-level `Makefile`
- Create an entry in `CHANGELOG.md`. Take a look at `git log v0.3..HEAD` and pick interesting updates (of course adjust `v0.3` to the previous version).
- Create a PR with your changes.
## Releasing
Once the PR is merged we can do the actual release.
- Update your local git clone to the lastest
- Identify the merge commit for your PR and tag it and push it to the main LinuxKit repository (remote `upstream` in my case):
```
git tag $LK_RELEASE master
git push upstream $LK_RELEASE
```
Then head over to GitHub and look at the `Releases` tab. You should see the new tag. Edit it:
- Add the changelog message
- Head over to the Circle CI page of the master build (try the Circle CI badge in the top level `README.md`)
- Download the artefacts and SHA256 sums file.
- Add the downloaded binaries to the release page (drag-and-drop below the editor window)
- Add the `sha256` sums to the release notes on the release page
Hit the `Publish release` button.
This completes the release, but you are not done, one more step is required.
## Post release
Create a PR which bumps the version number in the top-level `Makefile`
to `$LK_RELEASE+` to make sure that the version reported by `linuxkit
version` gets updated.

View File

@@ -0,0 +1,71 @@
# Reproducible builds
We aim to make the outputs of `linuxkit build` reproducible, i.e. the
build artefacts should be bit-by-bit identical copies if invoked with
the same inputs and run with the same version of the `linuxkit`
command. See [this
document](https://reproducible-builds.org/docs/buy-in/) on why this
matters.
_Note, we do not (yet) aim to make `linuxkit pkg build` builds
reproducible._
## Current status
Currently, the following output formats provide reproducible builds:
- `tar` (Tested as part of the CI)
- `tar-kernel-initrd`
- `docker`
- `kernel+initrd` (Tested as part of the CI)
## Details
In general, `linuxkit build` lends itself for reproducible
builds. LinuxKit packages, used during `linuxkit build`, are (signed)
docker images. Packages are tagged with the content hash of the source
code (and optionally release version) and are typically only updated
if the source of the package changed (in which case the tag
changes). For all intents and purposes, when pulled by tag, the
contents of a packages should be bit-by-bit identical. Alternatively,
the digest of the package, in which case, the pulled image will always
be the same.
The first phase of the `linuxkit build` mostly untars and retars the
images of the packages to produce an tar file of the root filesystem.
This then serves as input for other output formats. During this first
phase, there are a number of things to watch out for to generate
reproducible builds:
- Timestamps of generated files. The `docker export` command, as well
as `linuxkit build` itself, creates a small number of files. The
`ModTime` for these files needs to be clamped to a fixed date
(otherwise the current time is used). Use the `defaultModTime`
variable to set the `ModTime` of created files to a specific time.
- Generated JSON files. `linuxkit build` generates a number of JSON
files by marshalling Go `struct` variables. Examples are the OCI
specification `config.json` and `runtime.json` files for
containers. The default Go `json.Marshal()` function seems to do a
reasonable good job in generating reproducible output from internal
structures, including for JSON objects. However, during `linuxkit
build` some of the OCI runtime spec fields are generated/modified
and care must be taken to ensure consistent ordering. For JSON
arrays (Go slices) it is best to sort them before Marshalling them.
Reproducible builds for the first phase of `linuxkit build` can be
tested using `-output tar` and comparing the output of subsequent
builds with tools like `diff` or the excellent
[`diffoscope`](https://diffoscope.org/).
The second phase of `linuxkit build` converts the intermediary `tar`
format into the desired output format. Making this phase reproducible
depends on the tools used to generate the output.
Builds, which produce ISO formats should probably be converted to use
[`go-diskfs`](https://github.com/diskfs/go-diskfs) before attempting
to make them reproducible.
For ideas on how to make the builds for other output formats
reproducible, see [this
page](https://reproducible-builds.org/docs/system-images/).

View File

@@ -13,12 +13,6 @@ Details of usage of the `vndr` tool and the format of `vendor.conf` can be found
Once done, you must run the `vndr` tool to add the necessary files to the `vendor` directory.
The easiest way to do this is in a container.
Currently if updating `github.com/moby/tool` it is also necessary to
update `src/cmd/linuxkit/build.go` manually after updating `vendor.conf`:
hash=$(awk '/^github.com\/moby\/tool/ { print $2 }' src/cmd/linuxkit/vendor.conf)
curl -fsSL -o src/cmd/linuxkit/build.go https://raw.githubusercontent.com/moby/tool/${hash}/cmd/moby/build.go
## Updating in a container
To update all dependencies:
@@ -28,7 +22,7 @@ docker run -it --rm \
-v $(pwd):/go/src/github.com/linuxkit/linuxkit \
-w /go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit \
--entrypoint /go/bin/vndr \
linuxkit/go-compile:a8bffe875268a973ea82e5937b0fb23a5b08cc79
linuxkit/go-compile:8de0e27a38498389e43b3a5b520d943a2b3be5ba
```
To update a single dependency:
@@ -38,7 +32,7 @@ docker run -it --rm \
-v $(pwd):/go/src/github.com/linuxkit/linuxkit \
-w /go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit \
--entrypoint /go/bin/vndr \
linuxkit/go-compile:a8bffe875268a973ea82e5937b0fb23a5b08cc79
linuxkit/go-compile:8de0e27a38498389e43b3a5b520d943a2b3be5ba
github.com/docker/docker
```

278
docs/yaml.md Normal file
View File

@@ -0,0 +1,278 @@
# Configuration Reference
The `linuxkit build` command assembles a set of containerised components into in image. The simplest
type of image is just a `tar` file of the contents (useful for debugging) but more useful
outputs add a `Dockerfile` to build a container, or build a full disk image that can be
booted as a linuxKit VM. The main use case is to build an assembly that includes
`containerd` to run a set of containers, but the tooling is very generic.
The yaml configuration specifies the components used to build up an image . All components
are downloaded at build time to create an image. The image is self-contained and immutable,
so it can be tested reliably for continuous delivery.
Components are specified as Docker images which are pulled from a registry during build if they
are not available locally. The Docker images are optionally verified with Docker Content Trust.
For private registries or private repositories on a registry credentials provided via
`docker login` are re-used.
The configuration file is processed in the order `kernel`, `init`, `onboot`, `onshutdown`,
`services`, `files`. Each section adds files to the root file system. Sections may be omitted.
Each container that is specified is allocated a unique `uid` and `gid` that it may use if it
wishes to run as an isolated user (or user namespace). Anywhere you specify a `uid` or `gid`
field you specify either the numeric id, or if you use a name it will refer to the id allocated
to the container with that name.
```
services:
- name: redis
image: redis:latest
uid: redis
gid: redis
binds:
- /etc/redis:/etc/redis
files:
- path: /etc/redis/redis.conf
contents: "..."
uid: redis
gid: redis
mode: "0600"
```
## `kernel`
The `kernel` section is only required if booting a VM. The files will be put into the `boot/`
directory, where they are used to build bootable images.
The `kernel` section defines the kernel configuration. The `image` field specifies the Docker image,
which should contain a `kernel` file that will be booted (eg a `bzImage` for `amd64`) and a file
called `kernel.tar` which is a tarball that is unpacked into the root, which should usually
contain a kernel modules directory. `cmdline` specifies the kernel command line options if required.
To override the names, you can specify the kernel image name with `binary: bzImage` and the tar image
with `tar: kernel.tar` or the empty string or `none` if you do not want to use a tarball at all.
Kernel packages may also contain a cpio archive containing CPU microcode which needs prepending to
the initrd. To select this option, recommended when booting on bare metal, add `ucode: intel-ucode.cpio`
to the kernel section.
## `init`
The `init` section is a list of images that are used for the `init` system and are unpacked directly
into the root filesystem. This should bring up `containerd`, start the system and daemon containers,
and set up basic filesystem mounts. in the case of a LinuxKit system. For ease of
modification `runc` and `containerd` images, which just contain these programs are added here
rather than bundled into the `init` container.
## `onboot`
The `onboot` section is a list of images. These images are run before any other
images. They are run sequentially and each must exit before the next one is run.
These images can be used to configure one shot settings. See [Image
specification](#image-specification) for a list of supported fields.
## `onshutdown`
This is a list of images to run on a clean shutdown. Note that you must not rely on these
being run at all, as machines may be be powered off or shut down without having time to run
these scripts. If you add anything here you should test both in the case where they are
run and when they are not. Most systems are likely to be "crash only" and not have any setup here,
but you can attempt to deregister cleanly from a network service here, rather than relying
on timeouts, for example.
## `services`
The `services` section is a list of images for long running services which are
run with `containerd`. Startup order is undefined, so containers should wait
on any resources, such as networking, that they need. See [Image
specification](#image-specification) for a list of supported fields.
## `files`
The files section can be used to add files inline in the config, or from an external file.
```
files:
- path: dir
directory: true
mode: "0777"
- path: dir/name1
source: "/some/path/on/local/filesystem"
mode: "0666"
- path: dir/name2
source: "/some/path/that/it/is/ok/to/omit"
optional: true
mode: "0666"
- path: dir/name3
contents: "orange"
mode: "0644"
uid: 100
gid: 100
```
Specifying the `mode` is optional, and will default to `0600`. Leading directories will be
created if not specified. You can use `~/path` in `source` to specify a path in the build
user's home directory.
In addition there is a `metadata` option that will generate the file. Currently the only value
supported here is `"yaml"` which will output the yaml used to generate the image into the specified
file:
```
- path: etc/linuxkit.yml
metadata: yaml
```
Because a `tmpfs` is mounted onto `/var`, `/run`, and `/tmp` by default, the `tmpfs` mounts will shadow anything specified in `files` section for those directories.
## `trust`
The `trust` section specifies which build components are to be cryptographically verified with
[Docker Content Trust](https://docs.docker.com/engine/security/trust/content_trust/) prior to pulling.
Trust is a central concern in any build system, and LinuxKit's is no exception: Docker Content Trust provides authenticity,
integrity, and freshness guarantees for the components it verifies. The LinuxKit maintainers are responsible for signing
`linuxkit` components, though collaborators can sign their own images with Docker Content Trust or [Notary](https://github.com/docker/notary).
- `image` lists which individual images to enforce pulling with Docker Content Trust.
The image name may include tag or digest, but the matching also succeeds if the base image name is the same.
- `org` lists which organizations for which Docker Content Trust is to be enforced across all images,
for example `linuxkit` is the org for `linuxkit/kernel`
## Image specification
Entries in the `onboot` and `services` sections specify an OCI image and
options. Default values may be specified using the `org.mobyproject.config` image label.
For more details see the [OCI specification](https://github.com/opencontainers/runtime-spec/blob/master/spec.md).
If the `org.mobylinux.config` label is set in the image, that specifies default values for these fields if they
are not set in the yaml file. You can override the label by setting the value, or setting it to be empty to remove
the specification for that value in the label.
If you need an OCI option that is not specified here please open an issue or pull request as the list is not yet
complete.
By default the containers will be run in the host `net`, `ipc` and `uts` namespaces, as that is the usual requirement;
in many ways they behave like pods in Kubernetes. Mount points must already exist, as must a file or directory being
bind mounted into a container.
- `name` a unique name for the program being executed, used as the `containerd` id.
- `image` the Docker image to use for the root filesystem. The default command, path and environment are
extracted from this so they need not be filled in.
- `capabilities` the Linux capabilities required, for example `CAP_SYS_ADMIN`. If there is a single
capability `all` then all capabilities are added.
- `ambient` the Linux ambient capabilities (capabilities passed to non root users) that are required.
- `mounts` is the full form for specifying a mount, which requires `type`, `source`, `destination`
and a list of `options`. If any fields are omitted, sensible defaults are used if possible, for example
if the `type` is `dev` it is assumed you want to mount at `/dev`. The default mounts and their options
can be replaced by specifying a mount with new options here at the same mount point.
- `binds` is a simpler interface to specify bind mounts, accepting a string like `/src:/dest:opt1,opt2`
similar to the `-v` option for bind mounts in Docker.
- `tmpfs` is a simpler interface to mount a `tmpfs`, like `--tmpfs` in Docker, taking `/dest:opt1,opt2`.
- `command` will override the command and entrypoint in the image with a new list of commands.
- `env` will override the environment in the image with a new environment list. Specify variables as `VAR=value`.
- `cwd` will set the working directory, defaults to `/`.
- `net` sets the network namespace, either to a path, or if `none` or `new` is specified it will use a new namespace.
- `ipc` sets the ipc namespace, either to a path, or if `new` is specified it will use a new namespace.
- `uts` sets the uts namespace, either to a path, or if `new` is specified it will use a new namespace.
- `pid` sets the pid namespace, either to a path, or if `host` is specified it will use the host namespace.
- `readonly` sets the root filesystem to read only, and changes the other default filesystems to read only.
- `maskedPaths` sets paths which should be hidden.
- `readonlyPaths` sets paths to read only.
- `uid` sets the user id of the process.
- `gid` sets the group id of the process.
- `additionalGids` sets a list of additional groups for the process.
- `noNewPrivileges` is `true` means no additional capabilities can be acquired and `suid` binaries do not work.
- `hostname` sets the hostname inside the image.
- `oomScoreAdj` changes the OOM score.
- `rootfsPropagation` sets the rootfs propagation, eg `shared`, `slave` or (default) `private`.
- `cgroupsPath` sets the path for cgroups.
- `resources` sets cgroup resource limits as per the OCI spec.
- `sysctl` sets a map of `sysctl` key value pairs that are set inside the container namespace.
- `rmlimits` sets a list of `rlimit` values in the form `name,soft,hard`, eg `nofile,100,200`. You can use `unlimited` as a value too.
- `annotations` sets a map of key value pairs as OCI metadata.
There are experimental `userns`, `uidMappings` and `gidMappings` options for user namespaces but these are not yet supported, and may have
permissions issues in use.
In addition to the parts of the specification above used to generate the OCI spec, there is a `runtime` section in the image specification
which specifies some actions to take place when the container is being started.
- `cgroups` takes a list of cgroups that will be created before the container is run.
- `mounts` takes a list of mount specifications (`source`, `destination`, `type`, `options`) and mounts them in the root namespace before the container is created. It will
try to make any missing destination directories.
- `mkdir` takes a list of directories to create at runtime, in the root mount namespace. These are created before the container is started, so they can be used to create
directories for bind mounts, for example in `/tmp` or `/run` which would otherwise be empty.
- `interface` defines a list of actions to perform on a network interface:
- `name` specifies the name of an interface. An existing interface with this name will be moved into the container's network namespace.
- `add` specifies a type of interface to be created in the containers namespace, with the specified name.
- `createInRoot` is a boolean which specifes that the interface being `add`ed should be created in the root namespace first, then moved. This is needed for `wireguard` interfaces.
- `peer` specifies the name of the other end when creating a `veth` interface. This end will remain in the root namespace, where it can be attached to a bridge. Specifying this implies `add: veth`.
- `bindNS` specifies a namespace type and a path where the namespace from the container being created will be bound. This allows a namespace to be set up in an `onboot` container, and then
using `net: path` for a `service` container to use that network namespace later.
- `namespace` overrides the LinuxKit default containerd namespace to put the container in; only applicable to services.
An example of using the `runtime` config to configure a network namespace with `wireguard` and then run `nginx` in that namespace is shown below:
```
onboot:
- name: dhcpcd
image: linuxkit/dhcpcd:<hash>
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: wg
image: linuxkit/ip:<hash>
net: new
binds:
- /etc/wireguard:/etc/wireguard
command: ["sh", "-c", "ip link set dev wg0 up; ip address add dev wg0 192.168.2.1 peer 192.168.2.2; wg setconf wg0 /etc/wireguard/wg0.conf; wg show wg0"]
runtime:
interfaces:
- name: wg0
add: wireguard
createInRoot: true
bindNS:
net: /run/netns/wg
services:
- name: nginx
image: nginx:alpine
net: /run/netns/wg
capabilities:
- CAP_NET_BIND_SERVICE
- CAP_CHOWN
- CAP_SETUID
- CAP_SETGID
- CAP_DAC_OVERRIDE
```
### Mount Options
When mounting filesystem paths into a container - whether as part of `onboot` or `services` - there are several options of which you need to be aware. Using them properly is necessary for your containers to function properly.
For most containers - e.g. nginx or even docker - these options are not needed. Simply doing the following will work fine:
```yml
binds:
- /var:/some/var/path
```
Please note that `binds` doesn't **add** the mount points, but **replaces** them.
You can examine the `Dockerfile` of the component (in particular, `binds` value of
`org.mobyproject.config` label) to get the list of the existing binds.
However, in some circumstances you will need additional options. These options are used primarily if you intend to make changes to mount points _from within your container_ that should be visible from outside the container, e.g., if you intend to mount an external disk from inside the container but have it be visible outside.
In order for new mounts from within a container to be propagated, you must set the following on the container:
1. `rootfsPropagation: shared`
2. The mount point into the container below which new mounts are to occur must be `rshared,rbind`. In practice, this is `/var` (or some subdir of `/var`), since that is the only true read-write area of the filesystem where you will mount things.
Thus, if you have a regular container that is only reading and writing, go ahead and do:
```yml
binds:
- /var:/some/var/path
```
On the other hand, if you have a container that will make new mounts that you wish to be visible outside the container, do:
```yml
binds:
- /var:/var:rshared,rbind
rootfsPropagation: shared
```

View File

@@ -1,24 +1,24 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: metadata
image: linuxkit/metadata:v0.4
image: linuxkit/metadata:v0.7
services:
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
binds:
- /run/config/ssh/authorized_keys:/root/.ssh/authorized_keys
- name: nginx

View File

@@ -1,21 +1,21 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
services:
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
files:
- path: root/.ssh/authorized_keys
source: ~/.ssh/id_rsa.pub

View File

@@ -1,37 +1,37 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: sysfs
image: linuxkit/sysfs:v0.4
image: linuxkit/sysfs:v0.7
- name: format
image: linuxkit/format:v0.4
image: linuxkit/format:v0.7
- name: mount
image: linuxkit/mount:v0.4
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/var/lib/docker"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: ntpd
image: linuxkit/openntpd:v0.4
image: linuxkit/openntpd:v0.7
- name: docker
image: docker:17.10.0-ce-dind
image: docker:18.06.0-ce-dind
capabilities:
- all
net: host
@@ -46,7 +46,7 @@ services:
- /etc/docker/daemon.json:/etc/docker/daemon.json
command: ["/usr/local/bin/docker-init", "/usr/local/bin/dockerd"]
- name: cadvisor
image: linuxkit/cadvisor:v0.4
image: linuxkit/cadvisor:v0.7
files:
- path: var/lib/docker
directory: true

View File

@@ -0,0 +1,49 @@
kernel:
image: linuxkit/kernel:4.14.88
cmdline: "console=tty0 console=ttyS0"
init:
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: format
image: linuxkit/format:v0.7
command: ["/usr/bin/format", "/dev/sda"]
- name: mount
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/dev/sda1", "/var/external"]
- name: loop
image: linuxkit/losetup:v0.7
command: ["/usr/bin/loopy", "--create", "/var/external/storage_file"]
- name: dm-crypt
image: linuxkit/dm-crypt:v0.7
command: ["/usr/bin/crypto", "crypt_loop_dev", "/dev/loop0"]
- name: mount
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/dev/mapper/crypt_loop_dev", "/var/secure_storage"]
- name: bbox
image: busybox
command: ["sh", "-c", "echo 'secret things' >/var/secure_storage/secrets"]
binds:
- /var:/var
services:
- name: getty
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.7
files:
- path: etc/dm-crypt/key
# the below key is just to keep the example self-contained
# !!! provide a proper key for production use here !!!
contents: "abcdefghijklmnopqrstuvwxyz123456"
trust:
org:
- linuxkit

43
examples/dm-crypt.yml Normal file
View File

@@ -0,0 +1,43 @@
kernel:
image: linuxkit/kernel:4.14.88
cmdline: "console=tty0 console=ttyS0"
init:
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: format
image: linuxkit/format:v0.7
command: ["/usr/bin/format", "/dev/sda"]
- name: dm-crypt
image: linuxkit/dm-crypt:v0.7
command: ["/usr/bin/crypto", "crypt_dev", "/dev/sda1"]
- name: mount
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/dev/mapper/crypt_dev", "/var/secure_storage"]
- name: bbox
image: busybox
command: ["sh", "-c", "echo 'secret things' >/var/secure_storage/secrets"]
binds:
- /var:/var
services:
- name: getty
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.7
files:
- path: etc/dm-crypt/key
# the below key is just to keep the example self-contained
# !!! provide a proper key for production use here !!!
contents: "abcdefghijklmnopqrstuvwxyz123456"
trust:
org:
- linuxkit

View File

@@ -10,13 +10,13 @@ moment is to install a recent version of Docker for Mac.
To build it with the latest Docker CE:
```
$ linuxkit build docker-for-mac.yml
$ linuxkit build -format iso-efi docker-for-mac.yml
```
To run the VM with a 4G disk:
```
linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=4096M -data-file ./metadata.json docker-for-mac
linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=4096M -data-file ./metadata.json -iso -uefi docker-for-mac-efi
```
Where the file `./metadata.json` should contain the desired docker daemon
@@ -35,10 +35,10 @@ configuration, for example:
```
In another terminal you should now be able to access docker via the
socket `guest.00000947` in the state directory
(`docker-for-mac-state/` by default):
socket `guest.00000948` in the state directory
(`docker-for-mac-efi-state/` by default):
```
$ docker -H unix://docker-for-mac-state/guest.00000948 ps
$ docker -H unix://docker-for-mac-efi-state/guest.00000948 ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
```

View File

@@ -1,36 +1,36 @@
# This is an example for building the open source components of Docker for Mac
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0 page_poison=1"
init:
- linuxkit/vpnkit-expose-port:v0.4 # install vpnkit-expose-port and vpnkit-iptables-wrapper on host
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/vpnkit-expose-port:v0.7 # install vpnkit-expose-port and vpnkit-iptables-wrapper on host
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
# support metadata for optional config in /run/config
- name: metadata
image: linuxkit/metadata:v0.4
image: linuxkit/metadata:v0.7
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: sysfs
image: linuxkit/sysfs:v0.4
image: linuxkit/sysfs:v0.7
- name: binfmt
image: linuxkit/binfmt:v0.4
image: linuxkit/binfmt:v0.7
# Format and mount the disk image in /var/lib/docker
- name: format
image: linuxkit/format:v0.4
image: linuxkit/format:v0.7
- name: mount
image: linuxkit/mount:v0.4
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/var/lib"]
# make a swap file on the mounted disk
- name: swap
image: linuxkit/swap:v0.4
image: linuxkit/swap:v0.7
command: ["/swap.sh", "--path", "/var/lib/swap", "--size", "1024M"]
# mount-vpnkit mounts the 9p share used by vpnkit to coordinate port forwarding
- name: mount-vpnkit
image: alpine:3.7
image: alpine:3.9
binds:
- /var/:/host_var:rbind,rshared
capabilities:
@@ -39,51 +39,51 @@ onboot:
command: ["sh", "-c", "mkdir -p /host_var/vpnkit/port && mount -v -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 port /host_var/vpnkit"]
# move logs to the mounted disk (this is a temporary fix until we can limit the log sizes)
- name: move-logs
image: alpine:3.7
image: alpine:3.9
binds:
- /var:/host_var
command: ["sh", "-c", "mv -v /host_var/log /host_var/lib && ln -vs /var/lib/log /host_var/log"]
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
# Enable acpi to shutdown on power events
- name: acpid
image: linuxkit/acpid:v0.4
image: linuxkit/acpid:v0.7
# Enable getty for easier debugging
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
# Run ntpd to keep time synchronised in the VM
- name: ntpd
image: linuxkit/openntpd:v0.4
image: linuxkit/openntpd:v0.7
# VSOCK to unix domain socket forwarding. Forwards guest /var/run/docker.sock
# to a socket on the host.
- name: vsudd
image: linuxkit/vsudd:v0.4
image: linuxkit/vsudd:v0.7
binds:
- /var/run:/var/run
command: ["/vsudd", "-inport", "2376:unix:/var/run/docker.sock"]
# vpnkit-forwarder forwards network traffic to/from the host via VSOCK port 62373.
# It needs access to the vpnkit 9P coordination share
- name: vpnkit-forwarder
image: linuxkit/vpnkit-forwarder:v0.4
image: linuxkit/vpnkit-forwarder:v0.7
binds:
- /var/vpnkit:/port
net: host
command: ["/vpnkit-forwarder", "-vsockPort", "62373"]
# Monitor for image deletes and invoke a TRIM on the container filesystem
- name: trim-after-delete
image: linuxkit/trim-after-delete:v0.4
image: linuxkit/trim-after-delete:v0.7
# When the host resumes from sleep, force a clock resync
- name: host-timesync-daemon
image: linuxkit/host-timesync-daemon:v0.4
image: linuxkit/host-timesync-daemon:v0.7
# Run dockerd with the vpnkit userland proxy from the vpnkit-forwarder container.
# Bind mounts /var/run to allow vsudd to connect to docker.sock, /var/vpnkit
# for vpnkit coordination and /run/config/docker for the configuration file.
- name: docker-dfm
image: docker:17.07.0-ce-dind
image: docker:18.06.0-ce-dind
capabilities:
- all
net: host

View File

@@ -1,34 +1,34 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: sysfs
image: linuxkit/sysfs:v0.4
image: linuxkit/sysfs:v0.7
- name: format
image: linuxkit/format:v0.4
image: linuxkit/format:v0.7
- name: mount
image: linuxkit/mount:v0.4
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/var/lib/docker"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
- name: ntpd
image: linuxkit/openntpd:v0.4
image: linuxkit/openntpd:v0.7
- name: docker
image: docker:17.09.0-ce-dind
image: docker:18.06.0-ce-dind
capabilities:
- all
net: host

View File

@@ -1,28 +1,28 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: metadata
image: linuxkit/metadata:v0.4
image: linuxkit/metadata:v0.7
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
binds:
- /run/config/ssh/authorized_keys:/root/.ssh/authorized_keys
- name: nginx

View File

@@ -1,25 +1,25 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
# to make insecure with passwordless root login, uncomment following lines
#env:
# - INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
files:
- path: etc/getty.shadow
# sample sets password for root to "abcdefgh" (without quotes)

View File

@@ -1,16 +1,16 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
onshutdown:
- name: shutdown
@@ -18,7 +18,7 @@ onshutdown:
command: ["/bin/echo", "so long and thanks for all the fish"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
runtime:
@@ -30,7 +30,7 @@ services:
destination: writeable-host-etc
options: ["rw", "lowerdir=/etc", "upperdir=/run/hostetc/upper", "workdir=/run/hostetc/work"]
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: nginx
image: nginx:1.13.8-alpine
capabilities:

View File

@@ -1,47 +1,47 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: influxdb
image: influxdb:1.4
image: influxdb:1.7
net: host
capabilities:
- CAP_NET_BIND_SERVICE
- CAP_DAC_OVERRIDE
- name: kapacitor
image: kapacitor:1.4
image: kapacitor:1.5
net: host
capabilities:
- all
env:
- KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086
- name: telegraf
image: telegraf:1.4
image: telegraf:1.9
net: host
capabilities:
- all
- name: chronograf
image: chronograf:1.4
image: chronograf:1.7
net: host
capabilities:
- CAP_NET_BIND_SERVICE
- CAP_DAC_OVERRIDE
env:
- INFLUXDB_URL=http://localhost:8086
- KAPACITOR_URL=http://localhost:9092
- INFLUXDB_URL=http://127.0.0.1:8086
- KAPACITOR_URL=http://127.0.0.1:9092
trust:
org:
- linuxkit

34
examples/logging.yml Normal file
View File

@@ -0,0 +1,34 @@
# Simple example of using an external logging service
kernel:
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
- linuxkit/memlogd:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
# Inside the getty type `/proc/1/root/usr/bin/logread -F` to follow the log
- name: getty
image: linuxkit/getty:v0.7
env:
- INSECURE=true
# A service which generates log messages for testing
- name: write-to-the-logs
image: alpine:3.9
command: ["/bin/sh", "-c", "while /bin/true; do echo hello $(date); sleep 1; done" ]
- name: write-and-rotate-logs
image: linuxkit/logwrite:v0.7
- name: kmsg
image: linuxkit/kmsg:v0.7
trust:
org:
- linuxkit
- library

View File

@@ -1,17 +1,17 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
onboot:
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
trust:

View File

@@ -1,21 +1,21 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
- name: node_exporter
image: linuxkit/node_exporter:v0.4
image: linuxkit/node_exporter:v0.7
trust:
org:
- linuxkit

View File

@@ -1,25 +1,25 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: metadata
image: linuxkit/metadata:v0.4
image: linuxkit/metadata:v0.7
command: ["/usr/bin/metadata", "openstack"]
services:
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
binds:
- /run/config/ssh/authorized_keys:/root/.ssh/authorized_keys
- name: nginx

View File

@@ -5,10 +5,10 @@
# for arm64 then the 'ucode' line in the kernel section can be left
# out.
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyAMA0"
ucode: ""
onboot:
- name: modprobe
image: linuxkit/modprobe:v0.4
image: linuxkit/modprobe:v0.7
command: ["modprobe", "nicvf"]

View File

@@ -1,34 +1,34 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: console=ttyS1
ucode: intel-ucode.cpio
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/firmware:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
- linuxkit/firmware:v0.7
onboot:
- name: rngd1
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
command: ["/sbin/rngd", "-1"]
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: metadata
image: linuxkit/metadata:v0.4
image: linuxkit/metadata:v0.7
command: ["/usr/bin/metadata", "packet"]
services:
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
files:
- path: root/.ssh/authorized_keys
source: ~/.ssh/id_rsa.pub

View File

@@ -1,19 +1,19 @@
# Minimal YAML to run a redis server (used at DockerCon'17)
# connect: nc localhost 6379
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
onboot:
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
# Currently redis:4.0.6-alpine has trust issue with multi-arch

View File

@@ -1,25 +1,25 @@
kernel:
image: linuxkit/kernel:4.14.34-rt
image: linuxkit/kernel:4.19.25-rt
cmdline: "console=tty0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
- name: open-vm-tools
image: linuxkit/open-vm-tools:v0.4
image: linuxkit/open-vm-tools:v0.7
- name: nginx
image: nginx:1.13.8-alpine
capabilities:

29
examples/scaleway.yml Normal file
View File

@@ -0,0 +1,29 @@
kernel:
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0 root=/dev/vda"
init:
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.7
- name: rngd1
image: linuxkit/rngd:v0.7
command: ["/sbin/rngd", "-1"]
- name: dhcpcd
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: metadata
image: linuxkit/metadata:v0.7
services:
- name: getty
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.7
trust:
org:
- linuxkit

View File

@@ -1,28 +1,28 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: rngd1
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
command: ["/sbin/rngd", "-1"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
files:
- path: root/.ssh/authorized_keys
source: ~/.ssh/id_rsa.pub

32
examples/static-ip.yml Normal file
View File

@@ -0,0 +1,32 @@
kernel:
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
onboot:
- name: ip
image: linuxkit/ip:v0.7
binds:
- /etc/ip:/etc/ip
command: ["ip", "-b", "/etc/ip/eth0.conf"]
services:
- name: getty
image: linuxkit/getty:v0.7
env:
- INSECURE=true
files:
- path: etc/ip/eth0.conf
contents: |
address add 10.10.1.225/24 dev eth0
link set eth0 up
route add default via 10.10.1.100 dev eth0
- path: etc/resolv.conf
contents: |
# domain test.local
nameserver 10.10.1.101
nameserver 10.10.1.100
trust:
org:
- linuxkit

View File

@@ -1,34 +1,34 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: format
image: linuxkit/format:v0.4
image: linuxkit/format:v0.7
- name: mount
image: linuxkit/mount:v0.4
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/var/external"]
- name: swap
image: linuxkit/swap:v0.4
image: linuxkit/swap:v0.7
# to use unencrypted swap, use:
# command: ["/swap.sh", "--path", "/var/external/swap", "--size", "1G"]
command: ["/swap.sh", "--path", "/var/external/swap", "--size", "1G", "--encrypt"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
trust:
org:
- linuxkit

View File

@@ -2,25 +2,25 @@ kernel:
image: linuxkit/kernel:4.9.38
cmdline: "console=tty0 console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: tss
image: linuxkit/tss:v0.4
image: linuxkit/tss:v0.7
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
files:
- path: etc/getty.shadow
# sample sets password for root to "abcdefgh" (without quotes)

View File

@@ -1,23 +1,23 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
- name: nginx
image: nginx:1.13.8-alpine
capabilities:

View File

@@ -1,16 +1,16 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
onboot:
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: mount-vpnkit
image: alpine:3.7
image: alpine:3.9
binds:
- /var/:/host_var:rbind,rshared
capabilities:
@@ -19,9 +19,9 @@ onboot:
command: ["sh", "-c", "mkdir /host_var/vpnkit && mount -v -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 port /host_var/vpnkit"]
services:
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
- name: vpnkit-forwarder
image: linuxkit/vpnkit-forwarder:v0.4
image: linuxkit/vpnkit-forwarder:v0.7
binds:
- /var/vpnkit:/port
net: host

View File

@@ -1,17 +1,17 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
onboot:
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
- name: vsudd
image: linuxkit/vsudd:v0.4
image: linuxkit/vsudd:v0.7
binds:
- /run/containerd/containerd.sock:/run/containerd/containerd.sock
command: ["/vsudd",

View File

@@ -1,28 +1,28 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=ttyS0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: metadata
image: linuxkit/metadata:v0.4
image: linuxkit/metadata:v0.7
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: sshd
image: linuxkit/sshd:v0.4
image: linuxkit/sshd:v0.7
binds:
- /run/config/ssh/authorized_keys:/root/.ssh/authorized_keys
- name: nginx

View File

@@ -1,19 +1,19 @@
kernel:
image: linuxkit/kernel:4.14.40
image: linuxkit/kernel:4.19.34
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.4
- linuxkit/runc:v0.4
- linuxkit/containerd:v0.4
- linuxkit/ca-certificates:v0.4
- linuxkit/init:v0.7
- linuxkit/runc:v0.7
- linuxkit/containerd:v0.7
- linuxkit/ca-certificates:v0.7
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.4
image: linuxkit/sysctl:v0.7
- name: dhcpcd
image: linuxkit/dhcpcd:v0.4
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: wg0
image: linuxkit/ip:v0.4
image: linuxkit/ip:v0.7
net: new
binds:
- /etc/wireguard:/etc/wireguard
@@ -26,7 +26,7 @@ onboot:
bindNS:
net: /run/netns/wg0
- name: wg1
image: linuxkit/ip:v0.4
image: linuxkit/ip:v0.7
net: new
binds:
- /etc/wireguard:/etc/wireguard
@@ -40,12 +40,12 @@ onboot:
net: /run/netns/wg1
services:
- name: getty
image: linuxkit/getty:v0.4
image: linuxkit/getty:v0.7
env:
- INSECURE=true
net: /run/netns/wg1
- name: rngd
image: linuxkit/rngd:v0.4
image: linuxkit/rngd:v0.7
- name: nginx
image: nginx:1.13.8-alpine
net: /run/netns/wg0

View File

@@ -1,4 +1,4 @@
FROM linuxkit/alpine:90571a1a9059f3bf33ca3431bc5396aa837a47d3 AS kernel-build
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS kernel-build
RUN apk add \
argp-standalone \
automake \
@@ -15,9 +15,7 @@ RUN apk add \
gnupg \
installkernel \
kmod \
libelf-dev \
libressl \
libressl-dev \
elfutils-dev \
linux-headers \
mpc1-dev \
mpfr-dev \
@@ -38,12 +36,8 @@ ARG KERNEL_SERIES
ARG EXTRA
ARG DEBUG
ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz
ENV KERNEL_SHA256_SUMS=https://www.kernel.org/pub/linux/kernel/v4.x/sha256sums.asc
ENV KERNEL_PGP2_SIGN=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.sign
ENV WIREGUARD_VERSION=0.0.20180420
ENV WIREGUARD_SHA256="b58cd2acf9e8d3fe9044c06c0056bd74da1f5673a456f011d36eee3f6fb1da16"
ENV WIREGUARD_VERSION=0.0.20190227
ENV WIREGUARD_SHA256="fcdb26fd2692d9e1dee54d14418603c38fbb973a06ce89d08fbe45292ff37f79"
ENV WIREGUARD_URL=https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${WIREGUARD_VERSION}.tar.xz
# We copy the entire directory. This copies some unneeded files, but
@@ -53,7 +47,12 @@ COPY / /
# Download and verify kernel
# PGP keys: 589DA6B1 (greg@kroah.com) & 6092693E (autosigner@kernel.org) & 00411886 (torvalds@linux-foundation.org)
RUN curl -fsSLO ${KERNEL_SHA256_SUMS} && \
RUN KERNEL_MAJOR=$(echo ${KERNEL_VERSION} | cut -d . -f 1) && \
KERNEL_MAJOR=v${KERNEL_MAJOR}.x && \
KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/${KERNEL_MAJOR}/linux-${KERNEL_VERSION}.tar.xz && \
KERNEL_SHA256_SUMS=https://www.kernel.org/pub/linux/kernel/${KERNEL_MAJOR}/sha256sums.asc && \
KERNEL_PGP2_SIGN=https://www.kernel.org/pub/linux/kernel/${KERNEL_MAJOR}/linux-${KERNEL_VERSION}.tar.sign && \
curl -fsSLO ${KERNEL_SHA256_SUMS} && \
gpg2 -q --import keys.asc && \
gpg2 --verify sha256sums.asc && \
KERNEL_SHA256=$(grep linux-${KERNEL_VERSION}.tar.xz sha256sums.asc | cut -d ' ' -f 1) && \
@@ -84,6 +83,11 @@ RUN set -e && \
done; \
fi
RUN mkdir -p /out/src
# Save kernel source
RUN tar cJf /out/src/linux.tar.xz /linux
# Kernel config
RUN case $(uname -m) in \
x86_64) \
@@ -107,9 +111,8 @@ RUN case $(uname -m) in \
fi && \
make defconfig && \
make oldconfig && \
if [ -z "${EXTRA}" ] && [ -z "${DEBUG}" ]; then diff .config ${KERNEL_DEF_CONF}; fi
if [ -z "${EXTRA}" ] && [ -z "${DEBUG}" ]; then diff -u .config ${KERNEL_DEF_CONF}; fi
RUN mkdir /out
# Kernel
RUN make -j "$(getconf _NPROCESSORS_ONLN)" KCFLAGS="-fno-pie" && \
@@ -128,8 +131,9 @@ RUN make -j "$(getconf _NPROCESSORS_ONLN)" KCFLAGS="-fno-pie" && \
([ -n "${DEBUG}" ] && cp vmlinux /out || true)
# WireGuard
RUN curl -sSL -o /wireguard.tar.xz "${WIREGUARD_URL}" && \
RUN curl -fsSL -o /wireguard.tar.xz "${WIREGUARD_URL}" && \
echo "${WIREGUARD_SHA256} /wireguard.tar.xz" | sha256sum -c - && \
cp /wireguard.tar.xz /out/src/ && \
tar -C / --one-top-level=wireguard --strip-components=2 -xJf /wireguard.tar.xz "WireGuard-${WIREGUARD_VERSION}/src" && \
make -j "$(getconf _NPROCESSORS_ONLN)" M="/wireguard" modules
@@ -169,22 +173,12 @@ RUN DVER=$(basename $(find /tmp/kernel-modules/lib/modules/ -mindepth 1 -maxdept
RUN printf "KERNEL_SOURCE=${KERNEL_SOURCE}\n" > /out/kernel-source-info
# perf
# Skip for 4.4.x (the compile is broken and tedious to fix) and 4.9.x (the
# compile broke with 4.9.93)
RUN if [ "${KERNEL_SERIES}" != "4.4.x" ] && [ "${KERNEL_SERIES}" != "4.9.x" ]; then \
mkdir -p /build/perf && \
make -C tools/perf LDFLAGS=-static O=/build/perf && \
strip /build/perf/perf && \
cp /build/perf/perf /out; \
fi
# Download Intel ucode and create a CPIO archive for it
ENV UCODE_URL=https://downloadmirror.intel.com/27776/eng/microcode-20180425.tgz
ENV UCODE_URL=https://downloadmirror.intel.com/28087/eng/microcode-20180807a.tgz
RUN set -e && \
if [ $(uname -m) == x86_64 ]; then \
cd /ucode && \
curl -sSL -o microcode.tar.gz ${UCODE_URL} && \
curl -fsSL -o microcode.tar.gz ${UCODE_URL} && \
md5sum -c intel-ucode-md5sums && \
tar xf microcode.tar.gz && \
rm -f intel-ucode/list && \

122
kernel/Dockerfile.bcc Normal file
View File

@@ -0,0 +1,122 @@
ARG IMAGE
FROM ${IMAGE} as ksrc
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS build
RUN apk update && apk upgrade -a && \
apk add --no-cache \
argp-standalone \
autoconf \
automake \
bison \
build-base \
clang \
clang-dev \
clang-static \
cmake \
curl \
flex-dev \
fts-dev \
gettext-dev \
git \
iperf3 \
libedit-dev \
libtool \
llvm \
llvm-dev \
llvm-static \
luajit-dev \
m4 \
python \
zlib-dev \
&& true
RUN ln -s /usr/lib/cmake/llvm5/ /usr/lib/cmake/llvm && \
ln -s /usr/include/llvm5/llvm-c/ /usr/include/llvm-c && \
ln -s /usr/include/llvm5/llvm/ /usr/include/llvm
WORKDIR /build
COPY ./bcc.patches/ ./
RUN mv error.h /usr/include/ && \
mv cdefs.h /usr/include/sys/
ENV ELFUTILS_VERSION=0.165
ENV ELFUTILS_SHA256="a7fc9277192caaa5f30b47e8c0518dbcfd8c4a19c6493a63d511d804290ce972"
RUN curl -sSL -O https://fedorahosted.org/releases/e/l/elfutils/0.165/elfutils-$ELFUTILS_VERSION.tar.bz2 && \
echo "${ELFUTILS_SHA256} /build/elfutils-$ELFUTILS_VERSION.tar.bz2" | sha256sum -c - && \
tar xjf elfutils-$ELFUTILS_VERSION.tar.bz2 && \
cd elfutils-$ELFUTILS_VERSION && \
patch -p1 < ../100-musl-compat.patch && \
patch -p0 < ../decl.patch && \
patch -p0 < ../intl.patch
ENV BCC_COMMIT=6972806729da00ecda0235abac61d66c8fad7fad
RUN git clone https://github.com/iovisor/bcc.git && \
cd bcc && \
git checkout $BCC_COMMIT && \
patch -p0 < ../bcc-gnuism.patch && patch -p0 < ../bcc-lua.patch
ENV LJSYSCALL_COMMIT=e587f8c55aad3955dddab3a4fa6c1968037b5c6e
RUN git clone https://github.com/justincormack/ljsyscall.git && \
cd ljsyscall && \
git checkout $LJSYSCALL_COMMIT
COPY --from=ksrc /kernel-headers.tar /build
COPY --from=ksrc /kernel-dev.tar /build
COPY --from=ksrc /kernel.tar /build
RUN tar xf /build/kernel-headers.tar && \
tar xf /build/kernel-dev.tar && \
tar xf /build/kernel.tar
RUN cd elfutils-$ELFUTILS_VERSION && \
aclocal && \
automake && \
./configure --prefix=/usr CFLAGS=-Wno-strict-aliasing && \
make -C libelf && make -C libelf install
RUN mkdir -p bcc/build && cd bcc/build && \
cmake .. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_C_FLAGS="-I/build/usr/include" \
-DCMAKE_CXX_FLAGS="-I/build/usr/include" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLUAJIT_INCLUDE_DIR=/usr/include/luajit-2.1 && \
make && \
make install
RUN mkdir -p /usr/local/share/lua/5.1/ && \
cd ljsyscall && \
cp -a *.lua syscall /usr/local/share/lua/5.1/
RUN mkdir -p /out/usr/ && \
cp -a /build/usr/src /out/usr/ && \
cp -a /build/usr/include /out/usr
RUN mkdir -p /out/usr/lib && \
cp -a /usr/lib/libelf* /out/usr/lib/ && \
cp -a /usr/lib/libstdc* /out/usr/lib/ && \
cp -a /usr/lib/libintl* /out/usr/lib/ && \
cp -a /usr/lib64/* /out/usr/lib/
RUN mkdir -p /out/usr/lib/python2.7 && \
cp -a /usr/lib/python2.7/site-packages /out/usr/lib/python2.7/
RUN mkdir -p /out/usr/share && \
cp -a /usr/share/bcc /out/usr/share/
RUN mkdir -p /out/usr/bin && \
cp -a /usr/bin/bcc-lua /out/usr/bin/
RUN mkdir -p /out/usr/local/share/ && \
cp -a /usr/local/share/lua /out/usr/local/share/
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec as mirror
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk update && apk upgrade -a && \
apk add --no-cache --initdb -p /out \
busybox \
luajit \
python \
zlib \
&& true
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64
COPY --from=mirror /out /
COPY --from=build /out /

View File

@@ -1,4 +1,4 @@
FROM linuxkit/alpine:90571a1a9059f3bf33ca3431bc5396aa837a47d3 AS kernel-build
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS kernel-build
RUN apk add \
argp-standalone \
bison \
@@ -6,7 +6,10 @@ RUN apk add \
curl \
diffutils \
flex \
gmp-dev \
libarchive-tools \
mpc1-dev \
mpfr-dev \
ncurses-dev \
patch \
xz
@@ -18,8 +21,10 @@ COPY / /
# Unpack kernels (download if not present)
RUN set -e && \
for VERSION in ${KERNEL_VERSIONS}; do \
MAJOR=$(echo ${VERSION} | cut -d . -f 1) && \
MAJOR=v${MAJOR}.x && \
echo "Downloading/Unpacking $VERSION" && \
KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${VERSION}.tar.xz && \
KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/${MAJOR}/linux-${VERSION}.tar.xz && \
[ -f sources/linux-${VERSION}.tar.xz ] || curl -fSLo sources/linux-${VERSION}.tar.xz ${KERNEL_SOURCE} && \
bsdtar xf sources/linux-${VERSION}.tar.xz; \
done

View File

@@ -1,10 +1,43 @@
# This Dockerfile extracts the perf utility from a kernel package and
# places it into a scratch image
# This Dockerfile extracts the source code and headers from a kernel package,
# builds the perf utility, and places it into a scratch image
ARG IMAGE
FROM ${IMAGE} AS kernel
FROM ${IMAGE} AS ksrc
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS build
RUN apk add \
argp-standalone \
bash \
bc \
binutils-dev \
bison \
build-base \
diffutils \
flex \
gmp-dev \
installkernel \
kmod \
elfutils-dev \
mpc1-dev \
mpfr-dev \
sed \
tar \
xz \
xz-dev \
zlib-dev
COPY --from=ksrc /linux.tar.xz /kernel-headers.tar /
RUN tar xf linux.tar.xz && \
tar xf kernel-headers.tar
WORKDIR /linux
RUN mkdir -p /out && \
make -C tools/perf LDFLAGS=-static && \
strip tools/perf/perf && \
cp tools/perf/perf /out
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=kernel /perf /usr/bin/perf
COPY --from=build /out/perf /usr/bin/perf

View File

@@ -1,6 +1,6 @@
ARG IMAGE
FROM ${IMAGE} AS ksrc
FROM linuxkit/alpine:90571a1a9059f3bf33ca3431bc5396aa837a47d3 AS build
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS build
RUN apk add \
attr-dev \
autoconf \
@@ -23,10 +23,10 @@ COPY --from=ksrc /kernel.tar /
RUN tar xf kernel.tar
# Note: ZFS and SPL commits must match. It's unclear how much the user
# space tools must match the kernel module version. The current zfs
# package on Alpine is 0.6.5.9. We pick 0.6.5.10 because it has
# support for 4.12 based kernels.
ENV VERSION=0.6.5.10
# space tools must match the kernel module version.
# package on Alpine is 0.6.5.9. We pick the version that compiles with
# latest kernel we support.
ENV VERSION=0.7.12
ENV SPL_REPO=https://github.com/zfsonlinux/spl.git
ENV SPL_COMMIT=spl-${VERSION}

View File

@@ -15,6 +15,7 @@
# Name and Org on Hub
ORG?=linuxkit
IMAGE:=kernel
IMAGE_BCC:=kernel-bcc
IMAGE_PERF:=kernel-perf
IMAGE_ZFS:=zfs-kmod
@@ -71,18 +72,13 @@ endif
KERNEL_VERSIONS=
.PHONY: fetch build push
.PHONY: build push
# Targets:
# fetch: Downloads the kernel sources into ./sources
# build: Builds all kernels
# push: Pushes and sign all tagged kernel images to hub
fetch:
build:
push:
sources:
mkdir -p $@
# A template for defining kernel build
# Arguments:
# $1: Full kernel version, e.g., 4.9.22
@@ -99,8 +95,6 @@ sources:
define kernel
ifeq ($(4),)
sources/linux-$(1).tar.xz: Makefile | sources
curl -fsSLo sources/linux-$(1).tar.xz https://www.kernel.org/pub/linux/kernel/v4.x/linux-$(1).tar.xz
KERNEL_VERSIONS+=$(1)
endif
@@ -148,7 +142,6 @@ forcebuild: forcebuild_$(2)$(3)$(4)
push: push_$(2)$(3)$(4)
forcepush: forcepush_$(2)$(3)$(4)
show-tags: show-tag_$(2)$(3)$(4)
fetch: sources/linux-$(1).tar.xz
# 'docker build' with the FROM image supplied as --build-arg
# *and* with DOCKER_CONTENT_TRUST=1 currently does not work
@@ -156,8 +149,9 @@ fetch: sources/linux-$(1).tar.xz
# with DCT as part of the dependency on build_$(2)$(3)$(4) and then build
# with DOCKER_CONTENT_TRUST explicitly set to 0
ifneq ($(2), $(filter $(2),4.4.x 4.9.x))
# perf does not build out of the box for 4.4.x and 4.9.x
# Skip perf build for now. See:
# https://github.com/linuxkit/linuxkit/issues/3299
ifeq ($(ARCH),SKIP)
build_perf_$(2)$(3)$(4): build_$(2)$(3)$(4)
docker pull $(ORG)/$(IMAGE_PERF):$(1)$(3)$(4)-$(TAG)$(SUFFIX) || \
DOCKER_CONTENT_TRUST=0 docker build -f Dockerfile.perf \
@@ -192,6 +186,45 @@ push: push_perf_$(2)$(3)$(4)
forcepush: forcepush_perf_$(2)$(3)$(4)
endif
# Only build BCC on x86 and only on latest LTS and latest stable kernels.
ifeq ($(ARCH),x86_64)
ifneq ($(2), $(filter $(2),4.9.x))
build_bcc_$(2)$(3)$(4): build_$(2)$(3)$(4)
docker pull $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) || \
DOCKER_CONTENT_TRUST=0 docker build -f Dockerfile.bcc \
--build-arg IMAGE=$(ORG)/$(IMAGE):$(1)$(3)$(4)-$(TAG)$(SUFFIX) \
--no-cache $(LABEL) -t $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) .
forcebuild_bcc_$(2)$(3)$(4): build_$(2)$(3)$(4)
DOCKER_CONTENT_TRUST=0 docker build -f Dockerfile.bcc \
--build-arg IMAGE=$(ORG)/$(IMAGE):$(1)$(3)$(4)-$(TAG)$(SUFFIX) \
--no-cache $(LABEL) -t $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) .
push_bcc_$(2)$(3)$(4): build_bcc_$(2)$(3)$(4)
@if [ x"$(DIRTY)" != x ]; then echo "Your repository is not clean. Will not push image"; exit 1; fi
docker pull $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) || \
(docker push $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) && \
docker tag $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)$(SUFFIX) && \
docker push $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)$(SUFFIX) && \
$(PUSH_MANIFEST) $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG) $(DOCKER_CONTENT_TRUST) && \
$(PUSH_MANIFEST) $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4) $(DOCKER_CONTENT_TRUST))
forcepush_bcc_$(2)$(3)$(4): forcebuild_bcc_$(2)$(3)$(4)
@if [ x"$(DIRTY)" != x ]; then echo "Your repository is not clean. Will not push image"; exit 1; fi
docker push $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) && \
docker tag $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG)$(SUFFIX) $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)$(SUFFIX) && \
docker push $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)$(SUFFIX) && \
$(PUSH_MANIFEST) $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4)-$(TAG) $(DOCKER_CONTENT_TRUST) && \
$(PUSH_MANIFEST) $(ORG)/$(IMAGE_BCC):$(1)$(3)$(4) $(DOCKER_CONTENT_TRUST)
build: build_bcc_$(2)$(3)$(4)
forcebuild: forcebuild_bcc_$(2)$(3)$(4)
push: push_bcc_$(2)$(3)$(4)
forcepush: forcepush_bcc_$(2)$(3)$(4)
endif
endif
ifeq ($(4),)
# ZFS does not compile against -dbg kernels because CONFIG_DEBUG_LOCK_ALLOC
# is incompatible with CDDL, apparently (this is ./configure check)
@@ -218,21 +251,21 @@ endef
# Debug targets only for latest stable and LTS stable
#
ifeq ($(ARCH),x86_64)
$(eval $(call kernel,4.16.8,4.16.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.14.40,4.14.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.14.40,4.14.x,,-dbg))
$(eval $(call kernel,4.14.34,4.14.x,-rt,))
$(eval $(call kernel,4.9.99,4.9.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.4.131,4.4.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,5.0.7,5.0.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.19.34,4.19.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.19.34,4.19.x,,-dbg))
$(eval $(call kernel,4.19.25,4.19.x,-rt,))
$(eval $(call kernel,4.14.111,4.14.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.9.168,4.9.x,$(EXTRA),$(DEBUG)))
else ifeq ($(ARCH),aarch64)
$(eval $(call kernel,4.16.8,4.16.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.14.40,4.14.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.14.34,4.14.x,-rt,))
$(eval $(call kernel,5.0.7,5.0.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.19.34,4.19.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.19.25,4.19.x,-rt,))
else ifeq ($(ARCH),s390x)
$(eval $(call kernel,4.16.8,4.16.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.14.40,4.14.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,5.0.7,5.0.x,$(EXTRA),$(DEBUG)))
$(eval $(call kernel,4.19.34,4.19.x,$(EXTRA),$(DEBUG)))
endif
# Target for kernel config

View File

@@ -1,9 +1,9 @@
--- src/cc/usdt.h-orig
+++ src/cc/usdt.h
@@ -86,6 +86,24 @@
ArgumentParser(const char *arg) : arg_(arg), cur_pos_(0) {}
@@ -125,6 +125,24 @@ public:
ArgumentParser_powerpc64(const char *arg) : ArgumentParser(arg) {}
};
+#undef REG_A
+#undef REG_B
+#undef REG_C
@@ -23,5 +23,6 @@
+#undef REG_RIP
+
class ArgumentParser_x64 : public ArgumentParser {
private:
enum Register {
REG_A,

View File

@@ -0,0 +1,43 @@
--- src/cc/CMakeLists.txt
+++ src/cc/CMakeLists.txt
@@ -52,7 +52,7 @@ target_link_libraries(bcc-loader-static elf)
add_library(bcc-static STATIC
${bcc_common_sources} ${bcc_table_sources} ${bcc_util_sources})
set_target_properties(bcc-static PROPERTIES OUTPUT_NAME bcc)
-set(bcc-lua-static
+add_library(bcc-lua-static STATIC
${bcc_common_sources} ${bcc_table_sources} ${bcc_sym_sources} ${bcc_util_sources})
include(clang_libs)
@@ -64,9 +64,9 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f
set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static
-Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive
${LIBELF_LIBRARIES})
-set(bcc_common_libs_for_s ${bcc_common_libs_for_a})
-set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static
+set(bcc_common_libs_for_s b_frontend clang_frontend bpf-static
${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES})
+set(bcc_common_libs_for_lua ${bcc_common_libs_for_s})
if(ENABLE_CPP_API)
add_subdirectory(api)
@@ -87,7 +87,7 @@ add_subdirectory(frontends)
# Link against LLVM libraries
target_link_libraries(bcc-shared ${bcc_common_libs_for_s})
target_link_libraries(bcc-static ${bcc_common_libs_for_a} bcc-loader-static)
-set(bcc-lua-static ${bcc-lua-static} ${bcc_common_libs_for_lua})
+target_link_libraries(bcc-lua-static ${bcc_common_libs_for_lua})
install(TARGETS bcc-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${bcc_table_headers} DESTINATION include/bcc)
--- src/lua/CMakeLists.txt
+++ src/lua/CMakeLists.txt
@@ -23,7 +23,7 @@ if (LUAJIT_LIBRARIES AND LUAJIT)
add_executable(bcc-lua src/main.c bcc.o)
set_target_properties(bcc-lua PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(bcc-lua ${LUAJIT_LIBRARIES})
- target_link_libraries(bcc-lua ${bcc-lua-static})
+ target_link_libraries(bcc-lua -Wl,--whole-archive bcc-lua-static -Wl,--no-whole-archive)
if (NOT COMPILER_NOPIE_FLAG EQUAL "")
target_link_libraries(bcc-lua ${COMPILER_NOPIE_FLAG})
endif()

View File

@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.14.40 Kernel Configuration
# Linux/x86 4.14.111 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
@@ -250,6 +250,7 @@ CONFIG_SLAB_FREELIST_RANDOM=y
# CONFIG_SYSTEM_DATA_VERIFICATION is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_HOTPLUG_SMT=y
CONFIG_OPROFILE=y
# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
CONFIG_HAVE_OPROFILE=y
@@ -289,6 +290,7 @@ CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_RCU_TABLE_FREE=y
CONFIG_HAVE_RCU_TABLE_INVALIDATE=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
@@ -500,7 +502,7 @@ CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS=128
# CONFIG_SCHED_SMT is not set
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
CONFIG_SCHED_MC_PRIO=y
# CONFIG_PREEMPT_NONE is not set
@@ -615,11 +617,11 @@ CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y
CONFIG_SECCOMP=y
CONFIG_HZ_100=y
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
# CONFIG_KEXEC is not set
# CONFIG_KEXEC_FILE is not set
@@ -1079,7 +1081,7 @@ CONFIG_NETFILTER_XT_MATCH_HELPER=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPCOMP=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_IPVS=y
CONFIG_NETFILTER_XT_MATCH_IPVS=m
CONFIG_NETFILTER_XT_MATCH_L2TP=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
@@ -1121,7 +1123,7 @@ CONFIG_IP_SET_HASH_NET=y
CONFIG_IP_SET_HASH_NETPORT=y
CONFIG_IP_SET_HASH_NETIFACE=y
CONFIG_IP_SET_LIST_SET=y
CONFIG_IP_VS=y
CONFIG_IP_VS=m
CONFIG_IP_VS_IPV6=y
CONFIG_IP_VS_DEBUG=y
CONFIG_IP_VS_TAB_BITS=12
@@ -1139,18 +1141,18 @@ CONFIG_IP_VS_PROTO_SCTP=y
#
# IPVS scheduler
#
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_FO=y
CONFIG_IP_VS_OVF=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_RR=m
CONFIG_IP_VS_WRR=m
CONFIG_IP_VS_LC=m
CONFIG_IP_VS_WLC=m
CONFIG_IP_VS_FO=m
CONFIG_IP_VS_OVF=m
CONFIG_IP_VS_LBLC=m
CONFIG_IP_VS_LBLCR=m
CONFIG_IP_VS_DH=m
CONFIG_IP_VS_SH=m
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m
#
# IPVS SH scheduler
@@ -1160,7 +1162,7 @@ CONFIG_IP_VS_SH_TAB_BITS=8
#
# IPVS application helper
#
CONFIG_IP_VS_FTP=y
CONFIG_IP_VS_FTP=m
CONFIG_IP_VS_NFCT=y
# CONFIG_IP_VS_PE_SIP is not set
@@ -1202,7 +1204,7 @@ CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_CLUSTERIP=y
CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_TTL=y
CONFIG_IP_NF_RAW=y
@@ -1219,6 +1221,9 @@ CONFIG_NF_CONNTRACK_IPV6=y
# CONFIG_NF_SOCKET_IPV6 is not set
CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_CHAIN_ROUTE_IPV6=y
CONFIG_NFT_CHAIN_NAT_IPV6=y
CONFIG_NFT_MASQ_IPV6=y
CONFIG_NFT_REDIR_IPV6=y
CONFIG_NFT_REJECT_IPV6=y
CONFIG_NFT_DUP_IPV6=y
# CONFIG_NFT_FIB_IPV6 is not set
@@ -1226,10 +1231,7 @@ CONFIG_NF_DUP_IPV6=y
CONFIG_NF_REJECT_IPV6=y
CONFIG_NF_LOG_IPV6=y
CONFIG_NF_NAT_IPV6=y
CONFIG_NFT_CHAIN_NAT_IPV6=y
CONFIG_NF_NAT_MASQUERADE_IPV6=y
CONFIG_NFT_MASQ_IPV6=y
CONFIG_NFT_REDIR_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_MATCH_AH=y
CONFIG_IP6_NF_MATCH_EUI64=y
@@ -1254,27 +1256,27 @@ CONFIG_NF_TABLES_BRIDGE=y
CONFIG_NFT_BRIDGE_META=y
CONFIG_NFT_BRIDGE_REJECT=y
CONFIG_NF_LOG_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES=y
CONFIG_BRIDGE_EBT_BROUTE=y
CONFIG_BRIDGE_EBT_T_FILTER=y
CONFIG_BRIDGE_EBT_T_NAT=y
CONFIG_BRIDGE_EBT_802_3=y
CONFIG_BRIDGE_EBT_AMONG=y
CONFIG_BRIDGE_EBT_ARP=y
CONFIG_BRIDGE_EBT_IP=y
CONFIG_BRIDGE_EBT_IP6=y
CONFIG_BRIDGE_EBT_LIMIT=y
CONFIG_BRIDGE_EBT_MARK=y
CONFIG_BRIDGE_EBT_PKTTYPE=y
CONFIG_BRIDGE_EBT_STP=y
CONFIG_BRIDGE_EBT_VLAN=y
CONFIG_BRIDGE_EBT_ARPREPLY=y
CONFIG_BRIDGE_EBT_DNAT=y
CONFIG_BRIDGE_EBT_MARK_T=y
CONFIG_BRIDGE_EBT_REDIRECT=y
CONFIG_BRIDGE_EBT_SNAT=y
CONFIG_BRIDGE_EBT_LOG=y
CONFIG_BRIDGE_EBT_NFLOG=y
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_MARK=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
# CONFIG_IP_DCCP is not set
CONFIG_IP_SCTP=m
# CONFIG_NET_SCTPPROBE is not set
@@ -1966,7 +1968,10 @@ CONFIG_MLX5_ESWITCH=y
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_FEALNX is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
CONFIG_NET_VENDOR_NETRONOME=y
CONFIG_NFP=m
CONFIG_NFP_APP_FLOWER=y
# CONFIG_NFP_DEBUG is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_ETHOC is not set
@@ -2241,7 +2246,7 @@ CONFIG_TCG_NSC=m
CONFIG_TCG_ATMEL=m
CONFIG_TCG_INFINEON=m
CONFIG_TCG_XEN=m
CONFIG_TCG_CRB=m
CONFIG_TCG_CRB=y
CONFIG_TCG_VTPM_PROXY=m
CONFIG_TCG_TIS_ST33ZP24=m
CONFIG_TCG_TIS_ST33ZP24_I2C=m
@@ -3131,23 +3136,17 @@ CONFIG_XEN_HAVE_VPMU=y
# CONFIG_STAGING is not set
CONFIG_X86_PLATFORM_DEVICES=y
# CONFIG_ACERHDF is not set
# CONFIG_DELL_WMI is not set
# CONFIG_DELL_WMI_AIO is not set
# CONFIG_DELL_SMO8800 is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_HP_ACCEL is not set
# CONFIG_HP_WIRELESS is not set
# CONFIG_HP_WMI is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_MENLOW is not set
# CONFIG_ASUS_WIRELESS is not set
CONFIG_ACPI_WMI=y
CONFIG_WMI_BMOF=y
# CONFIG_PEAQ_WMI is not set
# CONFIG_ACPI_WMI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_INTEL_CHT_INT33FE is not set
# CONFIG_INTEL_HID_EVENT is not set
@@ -3155,8 +3154,6 @@ CONFIG_WMI_BMOF=y
CONFIG_INTEL_IPS=y
# CONFIG_INTEL_PMC_CORE is not set
# CONFIG_IBM_RTL is not set
CONFIG_MXM_WMI=y
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_PVPANIC is not set
@@ -3543,10 +3540,11 @@ CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
CONFIG_CIFS=y
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
# CONFIG_CIFS_WEAK_PW_HASH is not set
# CONFIG_CIFS_UPCALL is not set
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_POSIX is not set
# CONFIG_CIFS_ACL is not set
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
@@ -4056,7 +4054,6 @@ CONFIG_CRYPTO_DES3_EDE_X86_64=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SALSA20=y
CONFIG_CRYPTO_SALSA20_X86_64=y
CONFIG_CRYPTO_CHACHA20=y
CONFIG_CRYPTO_CHACHA20_X86_64=y
CONFIG_CRYPTO_SEED=y

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.9.99 Kernel Configuration
# Linux/x86 4.9.168 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
@@ -241,6 +241,7 @@ CONFIG_SLAB_FREELIST_RANDOM=y
# CONFIG_SYSTEM_DATA_VERIFICATION is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_HOTPLUG_SMT=y
CONFIG_OPROFILE=y
# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
CONFIG_HAVE_OPROFILE=y
@@ -2982,28 +2983,23 @@ CONFIG_XEN_HAVE_VPMU=y
# CONFIG_STAGING is not set
CONFIG_X86_PLATFORM_DEVICES=y
# CONFIG_ACERHDF is not set
# CONFIG_DELL_WMI_AIO is not set
# CONFIG_DELL_SMO8800 is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_HP_ACCEL is not set
# CONFIG_HP_WIRELESS is not set
# CONFIG_HP_WMI is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_MENLOW is not set
# CONFIG_ASUS_WIRELESS is not set
CONFIG_ACPI_WMI=y
# CONFIG_ACPI_WMI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_VBTN is not set
CONFIG_INTEL_IPS=y
# CONFIG_INTEL_PMC_CORE is not set
# CONFIG_IBM_RTL is not set
CONFIG_MXM_WMI=y
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_PVPANIC is not set
@@ -3340,7 +3336,7 @@ CONFIG_CIFS=y
# CONFIG_CIFS_WEAK_PW_HASH is not set
# CONFIG_CIFS_UPCALL is not set
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_POSIX is not set
# CONFIG_CIFS_ACL is not set
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,121 +0,0 @@
From: Boqun Feng <boqun.feng@gmail.com>
Date: Fri, 9 Mar 2018 14:56:28 +0800
Subject: [PATCH] rtmutex: Make rt_mutex_futex_unlock() safe for irq-off
callsites
Upstream commit 6b0ef92fee2a3189eba6d6b827b247cb4f6da7e9
When running rcutorture with TREE03 config, CONFIG_PROVE_LOCKING=y, and
kernel cmdline argument "rcutorture.gp_exp=1", lockdep reports a
HARDIRQ-safe->HARDIRQ-unsafe deadlock:
================================
WARNING: inconsistent lock state
4.16.0-rc4+ #1 Not tainted
--------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
takes:
__schedule+0xbe/0xaf0
{IN-HARDIRQ-W} state was registered at:
_raw_spin_lock+0x2a/0x40
scheduler_tick+0x47/0xf0
...
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&rq->lock);
<Interrupt>
lock(&rq->lock);
*** DEADLOCK ***
1 lock held by rcu_torture_rea/724:
rcu_torture_read_lock+0x0/0x70
stack backtrace:
CPU: 2 PID: 724 Comm: rcu_torture_rea Not tainted 4.16.0-rc4+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014
Call Trace:
lock_acquire+0x90/0x200
? __schedule+0xbe/0xaf0
_raw_spin_lock+0x2a/0x40
? __schedule+0xbe/0xaf0
__schedule+0xbe/0xaf0
preempt_schedule_irq+0x2f/0x60
retint_kernel+0x1b/0x2d
RIP: 0010:rcu_read_unlock_special+0x0/0x680
? rcu_torture_read_unlock+0x60/0x60
__rcu_read_unlock+0x64/0x70
rcu_torture_read_unlock+0x17/0x60
rcu_torture_reader+0x275/0x450
? rcutorture_booster_init+0x110/0x110
? rcu_torture_stall+0x230/0x230
? kthread+0x10e/0x130
kthread+0x10e/0x130
? kthread_create_worker_on_cpu+0x70/0x70
? call_usermodehelper_exec_async+0x11a/0x150
ret_from_fork+0x3a/0x50
This happens with the following even sequence:
preempt_schedule_irq();
local_irq_enable();
__schedule():
local_irq_disable(); // irq off
...
rcu_note_context_switch():
rcu_note_preempt_context_switch():
rcu_read_unlock_special():
local_irq_save(flags);
...
raw_spin_unlock_irqrestore(...,flags); // irq remains off
rt_mutex_futex_unlock():
raw_spin_lock_irq();
...
raw_spin_unlock_irq(); // accidentally set irq on
<return to __schedule()>
rq_lock():
raw_spin_lock(); // acquiring rq->lock with irq on
which means rq->lock becomes a HARDIRQ-unsafe lock, which can cause
deadlocks in scheduler code.
This problem was introduced by commit 02a7c234e540 ("rcu: Suppress
lockdep false-positive ->boost_mtx complaints"). That brought the user
of rt_mutex_futex_unlock() with irq off.
To fix this, replace the *lock_irq() in rt_mutex_futex_unlock() with
*lock_irq{save,restore}() to make it safe to call rt_mutex_futex_unlock()
with irq off.
Fixes: 02a7c234e540 ("rcu: Suppress lockdep false-positive ->boost_mtx complaints")
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
Link: https://lkml.kernel.org/r/20180309065630.8283-1-boqun.feng@gmail.com
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/locking/rtmutex.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1616,11 +1616,12 @@ bool __sched __rt_mutex_futex_unlock(str
void __sched rt_mutex_futex_unlock(struct rt_mutex *lock)
{
DEFINE_WAKE_Q(wake_q);
+ unsigned long flags;
bool postunlock;
- raw_spin_lock_irq(&lock->wait_lock);
+ raw_spin_lock_irqsave(&lock->wait_lock, flags);
postunlock = __rt_mutex_futex_unlock(lock, &wake_q);
- raw_spin_unlock_irq(&lock->wait_lock);
+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags);
if (postunlock)
rt_mutex_postunlock(&wake_q);

View File

@@ -1,49 +0,0 @@
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Tue, 19 Sep 2017 15:36:42 -0700
Subject: [PATCH] rcu: Suppress lockdep false-positive ->boost_mtx complaints
Upstream commit bcda31a2659497df39d6bedfbdf17498b4f4ac89
RCU priority boosting uses rt_mutex_init_proxy_locked() to initialize an
rt_mutex structure in locked state held by some other task. When that
other task releases it, lockdep complains (quite accurately, but a bit
uselessly) that the other task never acquired it. This complaint can
suppress other, more helpful, lockdep complaints, and in any case it is
a false positive.
This commit therefore switches from rt_mutex_unlock() to
rt_mutex_futex_unlock(), thereby avoiding the lockdep annotations.
Of course, if lockdep ever learns about rt_mutex_init_proxy_locked(),
addtional adjustments will be required.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/rcu/tree_plugin.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -31,11 +31,10 @@
#include <linux/smpboot.h>
#include <uapi/linux/sched/types.h>
#include "../time/tick-internal.h"
+#include "../locking/rtmutex_common.h"
#ifdef CONFIG_RCU_BOOST
-#include "../locking/rtmutex_common.h"
-
/*
* Control variables for per-CPU and per-rcu_node kthreads. These
* handle all flavors of RCU.
@@ -530,7 +529,7 @@ void rcu_read_unlock_special(struct task
/* Unboost if we were boosted. */
if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex)
- rt_mutex_unlock(&rnp->boost_mtx);
+ rt_mutex_futex_unlock(&rnp->boost_mtx);
/*
* If this was the last task on the expedited lists,

View File

@@ -1,26 +0,0 @@
From: Mikulas Patocka <mpatocka@redhat.com>
Date: Fri, 10 Nov 2017 12:29:34 -0500
Subject: [PATCH] brd: remove unused brd_mutex
Upstream commit 15f7b41f70ddcca3b555bd0fdc7c8da7466b517e
Remove unused mutex brd_mutex. It is unused since the commit ff26956875c2
("brd: remove support for BLKFLSBUF").
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/block/brd.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -60,7 +60,6 @@ struct brd_device {
/*
* Look up and return a brd's page for a given sector.
*/
-static DEFINE_MUTEX(brd_mutex);
static struct page *brd_lookup_page(struct brd_device *brd, sector_t sector)
{
pgoff_t idx;

View File

@@ -1,38 +0,0 @@
From: Christoffer Dall <christoffer.dall@linaro.org>
Date: Fri, 8 Sep 2017 07:07:13 -0700
Subject: [PATCH] KVM: arm/arm64: Remove redundant preemptible checks
Upstream commit 5a24575032971c5a9a4580417a791c427ebdb8e5
The __this_cpu_read() and __this_cpu_write() functions already implement
checks for the required preemption levels when using
CONFIG_DEBUG_PREEMPT which gives you nice error messages and such.
Therefore there is no need to explicitly check this using a BUG_ON() in
the code (which we don't do for other uses of per cpu variables either).
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
virt/kvm/arm/arm.c | 2 --
1 file changed, 2 deletions(-)
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -69,7 +69,6 @@ static DEFINE_PER_CPU(unsigned char, kvm
static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
{
- BUG_ON(preemptible());
__this_cpu_write(kvm_arm_running_vcpu, vcpu);
}
@@ -79,7 +78,6 @@ static void kvm_arm_set_running_vcpu(str
*/
struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
{
- BUG_ON(preemptible());
return __this_cpu_read(kvm_arm_running_vcpu);
}

View File

@@ -1,170 +0,0 @@
From: Scott Wood <swood@redhat.com>
Date: Sun, 21 Jan 2018 03:28:54 -0600
Subject: [PATCH 1/3] iommu/amd: Use raw locks on atomic context paths
Upstream commit 27790398c2aed917828dc3c6f81240d57f1584c9
Several functions in this driver are called from atomic context,
and thus raw locks must be used in order to be safe on PREEMPT_RT.
This includes paths that must wait for command completion, which is
a potential PREEMPT_RT latency concern but not easily avoidable.
Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 30 +++++++++++++++---------------
drivers/iommu/amd_iommu_init.c | 2 +-
drivers/iommu/amd_iommu_types.h | 4 ++--
3 files changed, 18 insertions(+), 18 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1054,9 +1054,9 @@ static int iommu_queue_command_sync(stru
unsigned long flags;
int ret;
- spin_lock_irqsave(&iommu->lock, flags);
+ raw_spin_lock_irqsave(&iommu->lock, flags);
ret = __iommu_queue_command_sync(iommu, cmd, sync);
- spin_unlock_irqrestore(&iommu->lock, flags);
+ raw_spin_unlock_irqrestore(&iommu->lock, flags);
return ret;
}
@@ -1082,7 +1082,7 @@ static int iommu_completion_wait(struct
build_completion_wait(&cmd, (u64)&iommu->cmd_sem);
- spin_lock_irqsave(&iommu->lock, flags);
+ raw_spin_lock_irqsave(&iommu->lock, flags);
iommu->cmd_sem = 0;
@@ -1093,7 +1093,7 @@ static int iommu_completion_wait(struct
ret = wait_on_sem(&iommu->cmd_sem);
out_unlock:
- spin_unlock_irqrestore(&iommu->lock, flags);
+ raw_spin_unlock_irqrestore(&iommu->lock, flags);
return ret;
}
@@ -3618,7 +3618,7 @@ static struct irq_remap_table *get_irq_t
goto out_unlock;
/* Initialize table spin-lock */
- spin_lock_init(&table->lock);
+ raw_spin_lock_init(&table->lock);
if (ioapic)
/* Keep the first 32 indexes free for IOAPIC interrupts */
@@ -3677,7 +3677,7 @@ static int alloc_irq_index(u16 devid, in
if (!table)
return -ENODEV;
- spin_lock_irqsave(&table->lock, flags);
+ raw_spin_lock_irqsave(&table->lock, flags);
/* Scan table for free entries */
for (c = 0, index = table->min_index;
@@ -3700,7 +3700,7 @@ static int alloc_irq_index(u16 devid, in
index = -ENOSPC;
out:
- spin_unlock_irqrestore(&table->lock, flags);
+ raw_spin_unlock_irqrestore(&table->lock, flags);
return index;
}
@@ -3721,7 +3721,7 @@ static int modify_irte_ga(u16 devid, int
if (!table)
return -ENOMEM;
- spin_lock_irqsave(&table->lock, flags);
+ raw_spin_lock_irqsave(&table->lock, flags);
entry = (struct irte_ga *)table->table;
entry = &entry[index];
@@ -3732,7 +3732,7 @@ static int modify_irte_ga(u16 devid, int
if (data)
data->ref = entry;
- spin_unlock_irqrestore(&table->lock, flags);
+ raw_spin_unlock_irqrestore(&table->lock, flags);
iommu_flush_irt(iommu, devid);
iommu_completion_wait(iommu);
@@ -3754,9 +3754,9 @@ static int modify_irte(u16 devid, int in
if (!table)
return -ENOMEM;
- spin_lock_irqsave(&table->lock, flags);
+ raw_spin_lock_irqsave(&table->lock, flags);
table->table[index] = irte->val;
- spin_unlock_irqrestore(&table->lock, flags);
+ raw_spin_unlock_irqrestore(&table->lock, flags);
iommu_flush_irt(iommu, devid);
iommu_completion_wait(iommu);
@@ -3778,9 +3778,9 @@ static void free_irte(u16 devid, int ind
if (!table)
return;
- spin_lock_irqsave(&table->lock, flags);
+ raw_spin_lock_irqsave(&table->lock, flags);
iommu->irte_ops->clear_allocated(table, index);
- spin_unlock_irqrestore(&table->lock, flags);
+ raw_spin_unlock_irqrestore(&table->lock, flags);
iommu_flush_irt(iommu, devid);
iommu_completion_wait(iommu);
@@ -4359,7 +4359,7 @@ int amd_iommu_update_ga(int cpu, bool is
if (!irt)
return -ENODEV;
- spin_lock_irqsave(&irt->lock, flags);
+ raw_spin_lock_irqsave(&irt->lock, flags);
if (ref->lo.fields_vapic.guest_mode) {
if (cpu >= 0)
@@ -4368,7 +4368,7 @@ int amd_iommu_update_ga(int cpu, bool is
barrier();
}
- spin_unlock_irqrestore(&irt->lock, flags);
+ raw_spin_unlock_irqrestore(&irt->lock, flags);
iommu_flush_irt(iommu, devid);
iommu_completion_wait(iommu);
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1474,7 +1474,7 @@ static int __init init_iommu_one(struct
{
int ret;
- spin_lock_init(&iommu->lock);
+ raw_spin_lock_init(&iommu->lock);
/* Add IOMMU to internal data structures */
list_add_tail(&iommu->list, &amd_iommu_list);
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -406,7 +406,7 @@ extern bool amd_iommu_iotlb_sup;
#define IRQ_TABLE_ALIGNMENT 128
struct irq_remap_table {
- spinlock_t lock;
+ raw_spinlock_t lock;
unsigned min_index;
u32 *table;
};
@@ -488,7 +488,7 @@ struct amd_iommu {
int index;
/* locks the accesses to the hardware */
- spinlock_t lock;
+ raw_spinlock_t lock;
/* Pointer to PCI device of this IOMMU */
struct pci_dev *dev;

View File

@@ -1,31 +0,0 @@
From: Scott Wood <swood@redhat.com>
Date: Sun, 28 Jan 2018 14:22:19 -0600
Subject: [PATCH 2/3] iommu/amd: Don't use dev_data in irte_ga_set_affinity()
Upstream commit 01ee04badefd296eb7a4430497373be9b7b16783
search_dev_data() acquires a non-raw lock, which can't be done
from atomic context on PREEMPT_RT. There is no need to look at
dev_data because guest_mode should never be set if use_vapic is
not set.
Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3861,10 +3861,8 @@ static void irte_ga_set_affinity(void *e
u8 vector, u32 dest_apicid)
{
struct irte_ga *irte = (struct irte_ga *) entry;
- struct iommu_dev_data *dev_data = search_dev_data(devid);
- if (!dev_data || !dev_data->use_vapic ||
- !irte->lo.fields_remap.guest_mode) {
+ if (!irte->lo.fields_remap.guest_mode) {
irte->hi.fields.vector = vector;
irte->lo.fields_remap.destination = dest_apicid;
modify_irte_ga(devid, index, irte, NULL);

View File

@@ -1,116 +0,0 @@
From: Scott Wood <swood@redhat.com>
Date: Wed, 14 Feb 2018 17:36:28 -0600
Subject: [PATCH 3/3] iommu/amd: Avoid locking get_irq_table() from atomic
context
Upstream commit df42a04b15f19a842393dc98a84cbc52b1f8ed49
get_irq_table() previously acquired amd_iommu_devtable_lock which is not
a raw lock, and thus cannot be acquired from atomic context on
PREEMPT_RT. Many calls to modify_irte*() come from atomic context due to
the IRQ desc->lock, as does amd_iommu_update_ga() due to the preemption
disabling in vcpu_load/put().
The only difference between calling get_irq_table() and reading from
irq_lookup_table[] directly, other than the lock acquisition and
amd_iommu_rlookup_table[] check, is if the table entry is unpopulated,
which should never happen when looking up a devid that came from an
irq_2_irte struct, as get_irq_table() would have already been called on
that devid during irq_remapping_alloc().
The lock acquisition is not needed in these cases because entries in
irq_lookup_table[] never change once non-NULL -- nor would the
amd_iommu_devtable_lock usage in get_irq_table() provide meaningful
protection if they did, since it's released before using the looked up
table in the get_irq_table() caller.
Rename the old get_irq_table() to alloc_irq_table(), and create a new
lockless get_irq_table() to be used in non-allocating contexts that WARNs
if it doesn't find what it's looking for.
Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3586,7 +3586,22 @@ static void set_dte_irq_entry(u16 devid,
amd_iommu_dev_table[devid].data[2] = dte;
}
-static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic)
+static struct irq_remap_table *get_irq_table(u16 devid)
+{
+ struct irq_remap_table *table;
+
+ if (WARN_ONCE(!amd_iommu_rlookup_table[devid],
+ "%s: no iommu for devid %x\n", __func__, devid))
+ return NULL;
+
+ table = irq_lookup_table[devid];
+ if (WARN_ONCE(!table, "%s: no table for devid %x\n", __func__, devid))
+ return NULL;
+
+ return table;
+}
+
+static struct irq_remap_table *alloc_irq_table(u16 devid, bool ioapic)
{
struct irq_remap_table *table = NULL;
struct amd_iommu *iommu;
@@ -3673,7 +3688,7 @@ static int alloc_irq_index(u16 devid, in
if (!iommu)
return -ENODEV;
- table = get_irq_table(devid, false);
+ table = alloc_irq_table(devid, false);
if (!table)
return -ENODEV;
@@ -3717,7 +3732,7 @@ static int modify_irte_ga(u16 devid, int
if (iommu == NULL)
return -EINVAL;
- table = get_irq_table(devid, false);
+ table = get_irq_table(devid);
if (!table)
return -ENOMEM;
@@ -3750,7 +3765,7 @@ static int modify_irte(u16 devid, int in
if (iommu == NULL)
return -EINVAL;
- table = get_irq_table(devid, false);
+ table = get_irq_table(devid);
if (!table)
return -ENOMEM;
@@ -3774,7 +3789,7 @@ static void free_irte(u16 devid, int ind
if (iommu == NULL)
return;
- table = get_irq_table(devid, false);
+ table = get_irq_table(devid);
if (!table)
return;
@@ -4092,7 +4107,7 @@ static int irq_remapping_alloc(struct ir
return ret;
if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC) {
- if (get_irq_table(devid, true))
+ if (alloc_irq_table(devid, true))
index = info->ioapic_pin;
else
ret = -ENOMEM;
@@ -4353,7 +4368,7 @@ int amd_iommu_update_ga(int cpu, bool is
if (!iommu)
return -ENODEV;
- irt = get_irq_table(devid, false);
+ irt = get_irq_table(devid);
if (!irt)
return -ENODEV;

View File

@@ -1,32 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:33 +0100
Subject: [PATCH 01/10] iommu/amd: Take into account that alloc_dev_data() may
return NULL
Upstream commit 39ffe39545cd5cb5b8cee9f0469165cf24dc62c2
find_dev_data() does not check whether the return value alloc_dev_data()
is NULL. This was okay once because the pointer was returned once as-is.
Since commit df3f7a6e8e85 ("iommu/amd: Use is_attach_deferred
call-back") the pointer may be used within find_dev_data() so a NULL
check is required.
Cc: Baoquan He <bhe@redhat.com>
Fixes: df3f7a6e8e85 ("iommu/amd: Use is_attach_deferred call-back")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -311,6 +311,8 @@ static struct iommu_dev_data *find_dev_d
if (dev_data == NULL) {
dev_data = alloc_dev_data(devid);
+ if (!dev_data)
+ return NULL;
if (translation_pre_enabled(iommu))
dev_data->defer_attach = true;

View File

@@ -1,97 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:34 +0100
Subject: [PATCH 02/10] iommu/amd: Turn dev_data_list into a lock less list
Upstream commit 779da73273fc4c4c6f41579a95e4fb7880a1720e
alloc_dev_data() adds new items to dev_data_list and search_dev_data()
is searching for items in this list. Both protect the access to the list
with a spinlock.
There is no need to navigate forth and back within the list and there is
also no deleting of a specific item. This qualifies the list to become a
lock less list and as part of this, the spinlock can be removed.
With this change the ordering of those items within the list is changed:
before the change new items were added to the end of the list, now they
are added to the front. I don't think it matters but wanted to mention
it.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 28 ++++++++++------------------
drivers/iommu/amd_iommu_types.h | 2 +-
2 files changed, 11 insertions(+), 19 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -84,8 +84,7 @@
static DEFINE_RWLOCK(amd_iommu_devtable_lock);
/* List of all available dev_data structures */
-static LIST_HEAD(dev_data_list);
-static DEFINE_SPINLOCK(dev_data_list_lock);
+static LLIST_HEAD(dev_data_list);
LIST_HEAD(ioapic_map);
LIST_HEAD(hpet_map);
@@ -204,40 +203,33 @@ static struct dma_ops_domain* to_dma_ops
static struct iommu_dev_data *alloc_dev_data(u16 devid)
{
struct iommu_dev_data *dev_data;
- unsigned long flags;
dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
if (!dev_data)
return NULL;
dev_data->devid = devid;
-
- spin_lock_irqsave(&dev_data_list_lock, flags);
- list_add_tail(&dev_data->dev_data_list, &dev_data_list);
- spin_unlock_irqrestore(&dev_data_list_lock, flags);
-
ratelimit_default_init(&dev_data->rs);
+ llist_add(&dev_data->dev_data_list, &dev_data_list);
return dev_data;
}
static struct iommu_dev_data *search_dev_data(u16 devid)
{
struct iommu_dev_data *dev_data;
- unsigned long flags;
+ struct llist_node *node;
+
+ if (llist_empty(&dev_data_list))
+ return NULL;
- spin_lock_irqsave(&dev_data_list_lock, flags);
- list_for_each_entry(dev_data, &dev_data_list, dev_data_list) {
+ node = dev_data_list.first;
+ llist_for_each_entry(dev_data, node, dev_data_list) {
if (dev_data->devid == devid)
- goto out_unlock;
+ return dev_data;
}
- dev_data = NULL;
-
-out_unlock:
- spin_unlock_irqrestore(&dev_data_list_lock, flags);
-
- return dev_data;
+ return NULL;
}
static int __last_alias(struct pci_dev *pdev, u16 alias, void *data)
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -625,7 +625,7 @@ struct devid_map {
*/
struct iommu_dev_data {
struct list_head list; /* For domain->dev_list */
- struct list_head dev_data_list; /* For global dev_data_list */
+ struct llist_node dev_data_list; /* For global dev_data_list */
struct protection_domain *domain; /* Domain the device is bound to */
u16 devid; /* PCI Device ID */
u16 alias; /* Alias Device ID */

View File

@@ -1,62 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:35 +0100
Subject: [PATCH 03/10] iommu/amd: Split domain id out of
amd_iommu_devtable_lock
Upstream commit 2bc00180890427dcc092b2f2b0d03c904bcade29
domain_id_alloc() and domain_id_free() is used for id management. Those
two function share a bitmap (amd_iommu_pd_alloc_bitmap) and set/clear
bits based on id allocation. There is no need to share this with
amd_iommu_devtable_lock, it can use its own lock for this operation.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -82,6 +82,7 @@
#define AMD_IOMMU_PGSIZES ((~0xFFFUL) & ~(2ULL << 38))
static DEFINE_RWLOCK(amd_iommu_devtable_lock);
+static DEFINE_SPINLOCK(pd_bitmap_lock);
/* List of all available dev_data structures */
static LLIST_HEAD(dev_data_list);
@@ -1596,29 +1597,26 @@ static void del_domain_from_list(struct
static u16 domain_id_alloc(void)
{
- unsigned long flags;
int id;
- write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ spin_lock(&pd_bitmap_lock);
id = find_first_zero_bit(amd_iommu_pd_alloc_bitmap, MAX_DOMAIN_ID);
BUG_ON(id == 0);
if (id > 0 && id < MAX_DOMAIN_ID)
__set_bit(id, amd_iommu_pd_alloc_bitmap);
else
id = 0;
- write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+ spin_unlock(&pd_bitmap_lock);
return id;
}
static void domain_id_free(int id)
{
- unsigned long flags;
-
- write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ spin_lock(&pd_bitmap_lock);
if (id > 0 && id < MAX_DOMAIN_ID)
__clear_bit(id, amd_iommu_pd_alloc_bitmap);
- write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+ spin_unlock(&pd_bitmap_lock);
}
#define DEFINE_FREE_PT_FN(LVL, FN) \

View File

@@ -1,50 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:36 +0100
Subject: [PATCH 04/10] iommu/amd: Split irq_lookup_table out of the
amd_iommu_devtable_lock
Upstream commit ea6166f4b83e9cfba1c18f46a764d50045682fe5
The function get_irq_table() reads/writes irq_lookup_table while holding
the amd_iommu_devtable_lock. It also modifies
amd_iommu_dev_table[].data[2].
set_dte_entry() is using amd_iommu_dev_table[].data[0|1] (under the
domain->lock) so it should be okay. The access to the iommu is
serialized with its own (iommu's) lock.
So split out get_irq_table() out of amd_iommu_devtable_lock's lock.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -83,6 +83,7 @@
static DEFINE_RWLOCK(amd_iommu_devtable_lock);
static DEFINE_SPINLOCK(pd_bitmap_lock);
+static DEFINE_SPINLOCK(iommu_table_lock);
/* List of all available dev_data structures */
static LLIST_HEAD(dev_data_list);
@@ -3600,7 +3601,7 @@ static struct irq_remap_table *alloc_irq
unsigned long flags;
u16 alias;
- write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ spin_lock_irqsave(&iommu_table_lock, flags);
iommu = amd_iommu_rlookup_table[devid];
if (!iommu)
@@ -3665,7 +3666,7 @@ static struct irq_remap_table *alloc_irq
iommu_completion_wait(iommu);
out_unlock:
- write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+ spin_unlock_irqrestore(&iommu_table_lock, flags);
return table;
}

View File

@@ -1,94 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:37 +0100
Subject: [PATCH 05/10] iommu/amd: Remove the special case from
alloc_irq_table()
Upstream commit fde65dd3d3096e8f6ecc7bbe544eb91f4220772c
alloc_irq_table() has a special ioapic argument. If set then it will
pre-allocate / reserve the first 32 indexes. The argument is only once
true and it would make alloc_irq_table() a little simpler if we would
extract the special bits to the caller.
The caller of irq_remapping_alloc() is holding irq_domain_mutex so the
initialization of iommu->irte_ops->set_allocated() should not race
against other user.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3594,7 +3594,7 @@ static struct irq_remap_table *get_irq_t
return table;
}
-static struct irq_remap_table *alloc_irq_table(u16 devid, bool ioapic)
+static struct irq_remap_table *alloc_irq_table(u16 devid)
{
struct irq_remap_table *table = NULL;
struct amd_iommu *iommu;
@@ -3628,10 +3628,6 @@ static struct irq_remap_table *alloc_irq
/* Initialize table spin-lock */
raw_spin_lock_init(&table->lock);
- if (ioapic)
- /* Keep the first 32 indexes free for IOAPIC interrupts */
- table->min_index = 32;
-
table->table = kmem_cache_alloc(amd_iommu_irq_cache, GFP_ATOMIC);
if (!table->table) {
kfree(table);
@@ -3646,12 +3642,6 @@ static struct irq_remap_table *alloc_irq
memset(table->table, 0,
(MAX_IRQS_PER_TABLE * (sizeof(u64) * 2)));
- if (ioapic) {
- int i;
-
- for (i = 0; i < 32; ++i)
- iommu->irte_ops->set_allocated(table, i);
- }
irq_lookup_table[devid] = table;
set_dte_irq_entry(devid, table);
@@ -3681,7 +3671,7 @@ static int alloc_irq_index(u16 devid, in
if (!iommu)
return -ENODEV;
- table = alloc_irq_table(devid, false);
+ table = alloc_irq_table(devid);
if (!table)
return -ENODEV;
@@ -4100,10 +4090,26 @@ static int irq_remapping_alloc(struct ir
return ret;
if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC) {
- if (alloc_irq_table(devid, true))
+ struct irq_remap_table *table;
+ struct amd_iommu *iommu;
+
+ table = alloc_irq_table(devid);
+ if (table) {
+ if (!table->min_index) {
+ /*
+ * Keep the first 32 indexes free for IOAPIC
+ * interrupts.
+ */
+ table->min_index = 32;
+ iommu = amd_iommu_rlookup_table[devid];
+ for (i = 0; i < 32; ++i)
+ iommu->irte_ops->set_allocated(table, i);
+ }
+ WARN_ON(table->min_index != 32);
index = info->ioapic_pin;
- else
+ } else {
ret = -ENOMEM;
+ }
} else {
index = alloc_irq_index(devid, nr_irqs);
}

View File

@@ -1,52 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:38 +0100
Subject: [PATCH 06/10] iommu/amd: Use `table' instead `irt' as variable name
in amd_iommu_update_ga()
Upstream commit 4fde541c9dc114c5b448ad34b0286fe8b7c550f1
The variable of type struct irq_remap_table is always named `table'
except in amd_iommu_update_ga() where it is called `irt'. Make it
consistent and name it also `table'.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -4353,7 +4353,7 @@ int amd_iommu_update_ga(int cpu, bool is
{
unsigned long flags;
struct amd_iommu *iommu;
- struct irq_remap_table *irt;
+ struct irq_remap_table *table;
struct amd_ir_data *ir_data = (struct amd_ir_data *)data;
int devid = ir_data->irq_2_irte.devid;
struct irte_ga *entry = (struct irte_ga *) ir_data->entry;
@@ -4367,11 +4367,11 @@ int amd_iommu_update_ga(int cpu, bool is
if (!iommu)
return -ENODEV;
- irt = get_irq_table(devid);
- if (!irt)
+ table = get_irq_table(devid);
+ if (!table)
return -ENODEV;
- raw_spin_lock_irqsave(&irt->lock, flags);
+ raw_spin_lock_irqsave(&table->lock, flags);
if (ref->lo.fields_vapic.guest_mode) {
if (cpu >= 0)
@@ -4380,7 +4380,7 @@ int amd_iommu_update_ga(int cpu, bool is
barrier();
}
- raw_spin_unlock_irqrestore(&irt->lock, flags);
+ raw_spin_unlock_irqrestore(&table->lock, flags);
iommu_flush_irt(iommu, devid);
iommu_completion_wait(iommu);

View File

@@ -1,66 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:39 +0100
Subject: [PATCH 07/10] iommu/amd: Factor out setting the remap table for a
devid
Upstream commit 2fcc1e8ac4a8514c64f946178fc36c2e30e56a41
Setting the IRQ remap table for a specific devid (or its alias devid)
includes three steps. Those three steps are always repeated each time
this is done.
Introduce a new helper function, move those steps there and use that
function instead. The compiler can still decide if it is worth to
inline.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3594,6 +3594,14 @@ static struct irq_remap_table *get_irq_t
return table;
}
+static void set_remap_table_entry(struct amd_iommu *iommu, u16 devid,
+ struct irq_remap_table *table)
+{
+ irq_lookup_table[devid] = table;
+ set_dte_irq_entry(devid, table);
+ iommu_flush_dte(iommu, devid);
+}
+
static struct irq_remap_table *alloc_irq_table(u16 devid)
{
struct irq_remap_table *table = NULL;
@@ -3614,9 +3622,7 @@ static struct irq_remap_table *alloc_irq
alias = amd_iommu_alias_table[devid];
table = irq_lookup_table[alias];
if (table) {
- irq_lookup_table[devid] = table;
- set_dte_irq_entry(devid, table);
- iommu_flush_dte(iommu, devid);
+ set_remap_table_entry(iommu, devid, table);
goto out;
}
@@ -3643,14 +3649,9 @@ static struct irq_remap_table *alloc_irq
(MAX_IRQS_PER_TABLE * (sizeof(u64) * 2)));
- irq_lookup_table[devid] = table;
- set_dte_irq_entry(devid, table);
- iommu_flush_dte(iommu, devid);
- if (devid != alias) {
- irq_lookup_table[alias] = table;
- set_dte_irq_entry(alias, table);
- iommu_flush_dte(iommu, alias);
- }
+ set_remap_table_entry(iommu, devid, table);
+ if (devid != alias)
+ set_remap_table_entry(iommu, alias, table);
out:
iommu_completion_wait(iommu);

View File

@@ -1,131 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:40 +0100
Subject: [PATCH 08/10] iommu/amd: Drop the lock while allocating new irq remap
table
Upstream commit 993ca6e063a69a0c65ca42ed449b6bc1b3844151
The irq_remap_table is allocated while the iommu_table_lock is held with
interrupts disabled.
>From looking at the call sites, all callers are in the early device
initialisation (apic_bsp_setup(), pci_enable_device(),
pci_enable_msi()) so make sense to drop the lock which also enables
interrupts and try to allocate that memory with GFP_KERNEL instead
GFP_ATOMIC.
Since during the allocation the iommu_table_lock is dropped, we need to
recheck if table exists after the lock has been reacquired. I *think*
that it is impossible that the "devid" entry appears in irq_lookup_table
while the lock is dropped since the same device can only be probed once.
However I check for both cases, just to be sure.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 63 ++++++++++++++++++++++++++++++++--------------
1 file changed, 45 insertions(+), 18 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3594,6 +3594,30 @@ static struct irq_remap_table *get_irq_t
return table;
}
+static struct irq_remap_table *__alloc_irq_table(void)
+{
+ struct irq_remap_table *table;
+
+ table = kzalloc(sizeof(*table), GFP_KERNEL);
+ if (!table)
+ return NULL;
+
+ table->table = kmem_cache_alloc(amd_iommu_irq_cache, GFP_KERNEL);
+ if (!table->table) {
+ kfree(table);
+ return NULL;
+ }
+ raw_spin_lock_init(&table->lock);
+
+ if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir))
+ memset(table->table, 0,
+ MAX_IRQS_PER_TABLE * sizeof(u32));
+ else
+ memset(table->table, 0,
+ (MAX_IRQS_PER_TABLE * (sizeof(u64) * 2)));
+ return table;
+}
+
static void set_remap_table_entry(struct amd_iommu *iommu, u16 devid,
struct irq_remap_table *table)
{
@@ -3605,6 +3629,7 @@ static void set_remap_table_entry(struct
static struct irq_remap_table *alloc_irq_table(u16 devid)
{
struct irq_remap_table *table = NULL;
+ struct irq_remap_table *new_table = NULL;
struct amd_iommu *iommu;
unsigned long flags;
u16 alias;
@@ -3623,42 +3648,44 @@ static struct irq_remap_table *alloc_irq
table = irq_lookup_table[alias];
if (table) {
set_remap_table_entry(iommu, devid, table);
- goto out;
+ goto out_wait;
}
+ spin_unlock_irqrestore(&iommu_table_lock, flags);
/* Nothing there yet, allocate new irq remapping table */
- table = kzalloc(sizeof(*table), GFP_ATOMIC);
- if (!table)
- goto out_unlock;
+ new_table = __alloc_irq_table();
+ if (!new_table)
+ return NULL;
- /* Initialize table spin-lock */
- raw_spin_lock_init(&table->lock);
+ spin_lock_irqsave(&iommu_table_lock, flags);
- table->table = kmem_cache_alloc(amd_iommu_irq_cache, GFP_ATOMIC);
- if (!table->table) {
- kfree(table);
- table = NULL;
+ table = irq_lookup_table[devid];
+ if (table)
goto out_unlock;
- }
- if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir))
- memset(table->table, 0,
- MAX_IRQS_PER_TABLE * sizeof(u32));
- else
- memset(table->table, 0,
- (MAX_IRQS_PER_TABLE * (sizeof(u64) * 2)));
+ table = irq_lookup_table[alias];
+ if (table) {
+ set_remap_table_entry(iommu, devid, table);
+ goto out_wait;
+ }
+ table = new_table;
+ new_table = NULL;
set_remap_table_entry(iommu, devid, table);
if (devid != alias)
set_remap_table_entry(iommu, alias, table);
-out:
+out_wait:
iommu_completion_wait(iommu);
out_unlock:
spin_unlock_irqrestore(&iommu_table_lock, flags);
+ if (new_table) {
+ kmem_cache_free(amd_iommu_irq_cache, new_table->table);
+ kfree(new_table);
+ }
return table;
}

View File

@@ -1,73 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:41 +0100
Subject: [PATCH 09/10] iommu/amd: Make amd_iommu_devtable_lock a spin_lock
Upstream commit 2cd1083d79a0a8c223af430ca97884c28a1e2fc0
Before commit 0bb6e243d7fb ("iommu/amd: Support IOMMU_DOMAIN_DMA type
allocation") amd_iommu_devtable_lock had a read_lock() user but now
there are none. In fact, after the mentioned commit we had only
write_lock() user of the lock. Since there is no reason to keep it as
writer lock, change its type to a spin_lock.
I *think* that we might even be able to remove the lock because all its
current user seem to have their own protection.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -81,7 +81,7 @@
*/
#define AMD_IOMMU_PGSIZES ((~0xFFFUL) & ~(2ULL << 38))
-static DEFINE_RWLOCK(amd_iommu_devtable_lock);
+static DEFINE_SPINLOCK(amd_iommu_devtable_lock);
static DEFINE_SPINLOCK(pd_bitmap_lock);
static DEFINE_SPINLOCK(iommu_table_lock);
@@ -2086,9 +2086,9 @@ static int attach_device(struct device *
}
skip_ats_check:
- write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ spin_lock_irqsave(&amd_iommu_devtable_lock, flags);
ret = __attach_device(dev_data, domain);
- write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+ spin_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
/*
* We might boot into a crash-kernel here. The crashed kernel
@@ -2138,9 +2138,9 @@ static void detach_device(struct device
domain = dev_data->domain;
/* lock device table */
- write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ spin_lock_irqsave(&amd_iommu_devtable_lock, flags);
__detach_device(dev_data);
- write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+ spin_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
if (!dev_is_pci(dev))
return;
@@ -2804,7 +2804,7 @@ static void cleanup_domain(struct protec
struct iommu_dev_data *entry;
unsigned long flags;
- write_lock_irqsave(&amd_iommu_devtable_lock, flags);
+ spin_lock_irqsave(&amd_iommu_devtable_lock, flags);
while (!list_empty(&domain->dev_list)) {
entry = list_first_entry(&domain->dev_list,
@@ -2812,7 +2812,7 @@ static void cleanup_domain(struct protec
__detach_device(entry);
}
- write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
+ spin_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
}
static void protection_domain_free(struct protection_domain *domain)

View File

@@ -1,40 +0,0 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 22 Mar 2018 16:22:42 +0100
Subject: [PATCH 10/10] iommu/amd: Return proper error code in
irq_remapping_alloc()
Upstream commit 29d049be9438278c47253a74cf8d0ddf36bd5d68
In the unlikely case when alloc_irq_table() is not able to return a
remap table then "ret" will be assigned with an error code. Later, the
code checks `index' and if it is negative (which it is because it is
initialized with `-1') and then then function properly aborts but
returns `-1' instead `-ENOMEM' what was intended.
In order to correct this, I assign -ENOMEM to index.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -4094,7 +4094,7 @@ static int irq_remapping_alloc(struct ir
struct amd_ir_data *data = NULL;
struct irq_cfg *cfg;
int i, ret, devid;
- int index = -1;
+ int index;
if (!info)
return -EINVAL;
@@ -4136,7 +4136,7 @@ static int irq_remapping_alloc(struct ir
WARN_ON(table->min_index != 32);
index = info->ioapic_pin;
} else {
- ret = -ENOMEM;
+ index = -ENOMEM;
}
} else {
index = alloc_irq_index(devid, nr_irqs);

View File

@@ -1,272 +0,0 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 20 Dec 2017 17:12:50 +0100
Subject: [PATCH 01/29] timers: Use static keys for migrate_enable/nohz_active
The members migrate_enable and nohz_active in the timer/hrtimer per CPU
bases have been introduced to avoid accessing global variables for these
decisions.
Still that results in a (cache hot) load and conditional branch, which can
be avoided by using static keys.
Implement it with static keys and optimize for the most critical case of
high performance networking which tends to disable the timer migration
functionality.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 4 --
kernel/time/hrtimer.c | 17 ++-------
kernel/time/tick-internal.h | 19 ++++++----
kernel/time/tick-sched.c | 2 -
kernel/time/timer.c | 83 ++++++++++++++++++++++----------------------
5 files changed, 61 insertions(+), 64 deletions(-)
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -153,8 +153,6 @@ enum hrtimer_base_type {
* @cpu: cpu number
* @active_bases: Bitfield to mark bases with active timers
* @clock_was_set_seq: Sequence counter of clock was set events
- * @migration_enabled: The migration of hrtimers to other cpus is enabled
- * @nohz_active: The nohz functionality is enabled
* @expires_next: absolute time of the next event which was scheduled
* via clock_set_next_event()
* @next_timer: Pointer to the first expiring timer
@@ -178,8 +176,6 @@ struct hrtimer_cpu_base {
unsigned int cpu;
unsigned int active_bases;
unsigned int clock_was_set_seq;
- bool migration_enabled;
- bool nohz_active;
#ifdef CONFIG_HIGH_RES_TIMERS
unsigned int in_hrtirq : 1,
hres_active : 1,
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -178,23 +178,16 @@ hrtimer_check_target(struct hrtimer *tim
#endif
}
-#ifdef CONFIG_NO_HZ_COMMON
-static inline
-struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
- int pinned)
-{
- if (pinned || !base->migration_enabled)
- return base;
- return &per_cpu(hrtimer_bases, get_nohz_timer_target());
-}
-#else
static inline
struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
int pinned)
{
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+ if (static_branch_unlikely(&timers_migration_enabled) && !pinned)
+ return &per_cpu(hrtimer_bases, get_nohz_timer_target());
+#endif
return base;
}
-#endif
/*
* We switch the timer base to a power-optimized selected CPU target,
@@ -973,7 +966,7 @@ void hrtimer_start_range_ns(struct hrtim
* Kick to reschedule the next tick to handle the new timer
* on dynticks target.
*/
- if (new_base->cpu_base->nohz_active)
+ if (is_timers_nohz_active())
wake_up_nohz_cpu(new_base->cpu_base->cpu);
} else {
hrtimer_reprogram(timer, new_base);
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -150,14 +150,19 @@ static inline void tick_nohz_init(void)
#ifdef CONFIG_NO_HZ_COMMON
extern unsigned long tick_nohz_active;
-#else
+extern void timers_update_nohz(void);
+extern struct static_key_false timers_nohz_active;
+static inline bool is_timers_nohz_active(void)
+{
+ return static_branch_unlikely(&timers_nohz_active);
+}
+# ifdef CONFIG_SMP
+extern struct static_key_false timers_migration_enabled;
+# endif
+#else /* CONFIG_NO_HZ_COMMON */
+static inline void timers_update_nohz(void) { }
#define tick_nohz_active (0)
-#endif
-
-#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-extern void timers_update_migration(bool update_nohz);
-#else
-static inline void timers_update_migration(bool update_nohz) { }
+static inline bool is_timers_nohz_active(void) { return false; }
#endif
DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1131,7 +1131,7 @@ static inline void tick_nohz_activate(st
ts->nohz_mode = mode;
/* One update is enough */
if (!test_and_set_bit(0, &tick_nohz_active))
- timers_update_migration(true);
+ timers_update_nohz();
}
/**
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -200,8 +200,6 @@ struct timer_base {
unsigned long clk;
unsigned long next_expiry;
unsigned int cpu;
- bool migration_enabled;
- bool nohz_active;
bool is_idle;
bool must_forward_clk;
DECLARE_BITMAP(pending_map, WHEEL_SIZE);
@@ -210,45 +208,59 @@ struct timer_base {
static DEFINE_PER_CPU(struct timer_base, timer_bases[NR_BASES]);
-#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+#ifdef CONFIG_NO_HZ_COMMON
+
+DEFINE_STATIC_KEY_FALSE(timers_nohz_active);
+static DEFINE_MUTEX(timer_keys_mutex);
+
+static void timer_update_keys(struct work_struct *work);
+static DECLARE_WORK(timer_update_work, timer_update_keys);
+
+#ifdef CONFIG_SMP
unsigned int sysctl_timer_migration = 1;
-void timers_update_migration(bool update_nohz)
+DEFINE_STATIC_KEY_FALSE(timers_migration_enabled);
+
+static void timers_update_migration(void)
{
bool on = sysctl_timer_migration && tick_nohz_active;
- unsigned int cpu;
- /* Avoid the loop, if nothing to update */
- if (this_cpu_read(timer_bases[BASE_STD].migration_enabled) == on)
- return;
+ if (on)
+ static_branch_enable(&timers_migration_enabled);
+ else
+ static_branch_disable(&timers_migration_enabled);
+}
+#else
+static inline void timers_update_migration(void) { }
+#endif /* !CONFIG_SMP */
- for_each_possible_cpu(cpu) {
- per_cpu(timer_bases[BASE_STD].migration_enabled, cpu) = on;
- per_cpu(timer_bases[BASE_DEF].migration_enabled, cpu) = on;
- per_cpu(hrtimer_bases.migration_enabled, cpu) = on;
- if (!update_nohz)
- continue;
- per_cpu(timer_bases[BASE_STD].nohz_active, cpu) = true;
- per_cpu(timer_bases[BASE_DEF].nohz_active, cpu) = true;
- per_cpu(hrtimer_bases.nohz_active, cpu) = true;
- }
+static void timer_update_keys(struct work_struct *work)
+{
+ mutex_lock(&timer_keys_mutex);
+ timers_update_migration();
+ static_branch_enable(&timers_nohz_active);
+ mutex_unlock(&timer_keys_mutex);
+}
+
+void timers_update_nohz(void)
+{
+ schedule_work(&timer_update_work);
}
int timer_migration_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos)
{
- static DEFINE_MUTEX(mutex);
int ret;
- mutex_lock(&mutex);
+ mutex_lock(&timer_keys_mutex);
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
if (!ret && write)
- timers_update_migration(false);
- mutex_unlock(&mutex);
+ timers_update_migration();
+ mutex_unlock(&timer_keys_mutex);
return ret;
}
-#endif
+#endif /* NO_HZ_COMMON */
static unsigned long round_jiffies_common(unsigned long j, int cpu,
bool force_up)
@@ -534,7 +546,7 @@ static void
static void
trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer)
{
- if (!IS_ENABLED(CONFIG_NO_HZ_COMMON) || !base->nohz_active)
+ if (!is_timers_nohz_active())
return;
/*
@@ -840,21 +852,20 @@ static inline struct timer_base *get_tim
return get_timer_cpu_base(tflags, tflags & TIMER_CPUMASK);
}
-#ifdef CONFIG_NO_HZ_COMMON
static inline struct timer_base *
get_target_base(struct timer_base *base, unsigned tflags)
{
-#ifdef CONFIG_SMP
- if ((tflags & TIMER_PINNED) || !base->migration_enabled)
- return get_timer_this_cpu_base(tflags);
- return get_timer_cpu_base(tflags, get_nohz_timer_target());
-#else
- return get_timer_this_cpu_base(tflags);
+#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
+ if (static_branch_unlikely(&timers_migration_enabled) &&
+ !(tflags & TIMER_PINNED))
+ return get_timer_cpu_base(tflags, get_nohz_timer_target());
#endif
+ return get_timer_this_cpu_base(tflags);
}
static inline void forward_timer_base(struct timer_base *base)
{
+#ifdef CONFIG_NO_HZ_COMMON
unsigned long jnow;
/*
@@ -878,16 +889,8 @@ static inline void forward_timer_base(st
base->clk = jnow;
else
base->clk = base->next_expiry;
-}
-#else
-static inline struct timer_base *
-get_target_base(struct timer_base *base, unsigned tflags)
-{
- return get_timer_this_cpu_base(tflags);
-}
-
-static inline void forward_timer_base(struct timer_base *base) { }
#endif
+}
/*

View File

@@ -1,36 +0,0 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 20 Dec 2017 17:12:51 +0100
Subject: [PATCH 02/29] hrtimer: Correct blantanly wrong comment
The protection of a hrtimer which runs its callback against migration to a
different CPU has nothing to do with hard interrupt context.
The protection against migration of a hrtimer running the expiry callback
is the pointer in the cpu_base which holds a pointer to the currently
running timer. This pointer is evaluated in the code which potentially
switches the timer base and makes sure it's kept on the CPU on which the
callback is running.
Reported-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1204,9 +1204,9 @@ static void __run_hrtimer(struct hrtimer
timer->is_rel = false;
/*
- * Because we run timers from hardirq context, there is no chance
- * they get migrated to another cpu, therefore its safe to unlock
- * the timer base.
+ * The timer is marked as running in the cpu base, so it is
+ * protected against migration to a different CPU even if the lock
+ * is dropped.
*/
raw_spin_unlock(&cpu_base->lock);
trace_hrtimer_expire_entry(timer, now);

View File

@@ -1,42 +0,0 @@
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
Date: Wed, 20 Dec 2017 17:12:52 +0100
Subject: [PATCH 03/29] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base
The sequence '/**' marks the start of a struct description. Add the
missing second asterisk. While at it adapt the ordering of the struct
members to the struct definition and document the purpose of
expires_next more precisely.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -144,7 +144,7 @@ enum hrtimer_base_type {
HRTIMER_MAX_CLOCK_BASES,
};
-/*
+/**
* struct hrtimer_cpu_base - the per cpu clock bases
* @lock: lock protecting the base and associated clock bases
* and timers
@@ -153,12 +153,12 @@ enum hrtimer_base_type {
* @cpu: cpu number
* @active_bases: Bitfield to mark bases with active timers
* @clock_was_set_seq: Sequence counter of clock was set events
- * @expires_next: absolute time of the next event which was scheduled
- * via clock_set_next_event()
- * @next_timer: Pointer to the first expiring timer
* @in_hrtirq: hrtimer_interrupt() is currently executing
* @hres_active: State of high resolution mode
* @hang_detected: The last hrtimer interrupt detected a hang
+ * @expires_next: absolute time of the next event, is required for remote
+ * hrtimer enqueue
+ * @next_timer: Pointer to the first expiring timer
* @nr_events: Total number of hrtimer interrupt events
* @nr_retries: Total number of hrtimer interrupt retries
* @nr_hangs: Total number of hrtimer interrupt hangs

View File

@@ -1,80 +0,0 @@
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
Date: Wed, 20 Dec 2017 17:12:53 +0100
Subject: [PATCH 04/29] hrtimer: Cleanup clock argument in
schedule_hrtimeout_range_clock()
schedule_hrtimeout_range_clock() uses an integer for the clock id
instead of the predefined type "clockid_t". The ID of the clock is
indicated in hrtimer code as clock_id. Therefore change the name of
the variable as well to make it consistent.
While at it, clean up the description for the function parameters clock_id
and mode. The clock modes and the clock ids are not restricted as the
comment suggests. Fix the mode description as well for the callers of
schedule_hrtimeout_range_clock().
No functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 2 +-
kernel/time/hrtimer.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -462,7 +462,7 @@ extern int schedule_hrtimeout_range(ktim
extern int schedule_hrtimeout_range_clock(ktime_t *expires,
u64 delta,
const enum hrtimer_mode mode,
- int clock);
+ clockid_t clock_id);
extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
/* Soft interrupt function to run the hrtimer queues: */
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1672,12 +1672,12 @@ void __init hrtimers_init(void)
* schedule_hrtimeout_range_clock - sleep until timeout
* @expires: timeout value (ktime_t)
* @delta: slack in expires timeout (ktime_t)
- * @mode: timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
- * @clock: timer clock, CLOCK_MONOTONIC or CLOCK_REALTIME
+ * @mode: timer mode
+ * @clock_id: timer clock to be used
*/
int __sched
schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta,
- const enum hrtimer_mode mode, int clock)
+ const enum hrtimer_mode mode, clockid_t clock_id)
{
struct hrtimer_sleeper t;
@@ -1698,7 +1698,7 @@ schedule_hrtimeout_range_clock(ktime_t *
return -EINTR;
}
- hrtimer_init_on_stack(&t.timer, clock, mode);
+ hrtimer_init_on_stack(&t.timer, clock_id, mode);
hrtimer_set_expires_range_ns(&t.timer, *expires, delta);
hrtimer_init_sleeper(&t, current);
@@ -1720,7 +1720,7 @@ schedule_hrtimeout_range_clock(ktime_t *
* schedule_hrtimeout_range - sleep until timeout
* @expires: timeout value (ktime_t)
* @delta: slack in expires timeout (ktime_t)
- * @mode: timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
+ * @mode: timer mode
*
* Make the current task sleep until the given expiry time has
* elapsed. The routine will return immediately unless
@@ -1759,7 +1759,7 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_ran
/**
* schedule_hrtimeout - sleep until timeout
* @expires: timeout value (ktime_t)
- * @mode: timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
+ * @mode: timer mode
*
* Make the current task sleep until the given expiry time has
* elapsed. The routine will return immediately unless

Some files were not shown because too many files have changed in this diff Show More