Commit Graph

333 Commits

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