Commit Graph

371 Commits

Author SHA1 Message Date
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
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