Commit Graph

380 Commits

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