Commit Graph

715 Commits

Author SHA1 Message Date
Tycho Andersen
a4e0a594b1 add a static usermode helper
The binary is used in tandem with CONFIG_STATIC_USERMODEHELPER=y in 4.11+,
see the big comment in the binary for the current whitelist of binaries.

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-06-15 10:39:52 -07:00
Riyaz Faizullabhoy
6dedac2fe9 Update getty image for setsid changes
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-15 09:16:12 -07:00
Justin Cormack
7cf06bb284 Merge pull request #2038 from rn/cold-plug
Support cold-plugging devices
2017-06-15 18:07:17 +02:00
Avi Deitcher
42bf54de28 copy setsid to setsidu so it does not get overwritten by busybox when used in init, and ensure inittab is clean
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-06-14 13:22:18 +03:00
Rolf Neugebauer
4e4efcd985 pkg: Add support for cold-plugged devices to init
mdev only supports hot-plug, ie devices which are added
after the kernel booted. For cold-plugged devices, ie devices
present when the kernel boots, we need to modprobe the drivers
differently. The additions to rc.init does just that.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-13 15:57:24 -07:00
Riyaz Faizullabhoy
35977c53d6 Merge pull request #2022 from justincormack/sys-in-getty
mount /sys in getty container and add and fix kernel tests
2017-06-12 09:29:44 -07:00
Magnus Skjegstad
24ec30e74c vpnkit-forwarder: add /pkg/vpnkit-forwarder
Adds /pkg/vpnkit-forwarder which downloads and builds vpnkit-forwarder
and vpnkit-expose-port from moby/vpnkit. Also includes an example for
forwarding `sshd` and updates the documentation for `hyperkit` to
include a `vpnkit` section.

`vpnkit` still requires a 9P mount for coordination, so the `socat`
forwarding is simpler to set up at the moment.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-06-12 14:46:48 +01:00
Justin Cormack
19b3beff9f Mount system /sys into getty container
Without this the mounts underneath here were not visible.

fix #2019

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-12 10:44:14 +02:00
Ken Cochrane
7dafc3be01 Added more AWS metadata to /var/config
Signed-off-by: Ken Cochrane <kencochrane@gmail.com>
2017-06-10 10:54:43 -04:00
Riyaz Faizullabhoy
8726adaa78 s/moby/linuxkit for run
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-08 17:10:14 -07:00
Riyaz Faizullabhoy
9c8e82734d fix disk size arg
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-06-08 17:09:52 -07:00
Avi Deitcher
f2cece3c61 Fix perms on /etc/init.d/000-issue
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-06-08 18:49:29 +03:00
Justin Cormack
e0dc6302a8 Merge pull request #1978 from deitch/gettyless-init
Remove all getty from init
2017-06-08 15:33:21 +01:00
Justin Cormack
513f661458 Clean up getty Makefile to match others
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-08 11:02:48 +01:00
Riyaz Faizullabhoy
33d66d380e Merge pull request #1994 from tych0/fix-pkg-builds
fix package builds in some cases
2017-06-07 17:49:32 -07:00
Justin Cormack
9b82914f7d Run make tag on pkg directory to check packages build
This at least checks for buildability of packages, even if we
are not yet pushing them.

See https://github.com/linuxkit/linuxkit/issues/1991 for what it mitigates.
Will not pass until this is fixed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-07 16:37:36 -06:00
Tycho Andersen
cf9397786c fix up second rngd containerd->alpine typo
Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-06-07 16:36:38 -06:00
Tycho Andersen
a208413ac0 fix package builds in some cases
0eb21735ae accidentally broke some package
builds by switching linuxkit/alpine to linuxkit/containerd. Let's revert
the ones that shouldn't be there.

Closes #1991

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-06-07 16:19:40 -06:00
Justin Cormack
09e6ff2e34 Merge pull request #1977 from deitch/console-login
Add getty pkg
2017-06-07 23:15:47 +01:00
Avi Deitcher
5db7e6fe69 Add getty pkg
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-06-08 00:11:53 +03:00
Riyaz Faizullabhoy
efbeea75d0 Merge pull request #1951 from dave-tucker/ports
Test that no ports are open
2017-06-07 11:30:13 -07:00
Dave Tucker
1af1a20a0d containerd: Don't expose metrics by default
This can be turned on if required but we'll default to leaving it off
It's been enabled in the top-level linuxkit.yml
This port is also non-standard and there doesn't appear to be a standard
port for this as yet.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-07 15:18:13 +01:00
Avi Deitcher
a7c577468d Remove all tty init from init
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-06-07 15:43:40 +03:00
Rolf Neugebauer
0c1498d8fa docs: Update platform documentation
- Prefix platform documentation with 'platform-'
- Add/Correct links from top-level README.md
- Tweak the Azure documentation
- Move the vsudd README to platform-hyperkit.md
- Add a dummy document for qemu/kvm

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-07 13:39:41 +01:00
Ian Campbell
0eb21735ae Update to containerd bdf9f5f7388e8203e63a74b89800f7f3dd4a7743
Note that this is not the latest (which was 95efd45db073 at time of writing)
but the next commit 6428b4bad0c2 merges "Port ctr to use client package" breaks
the use of `ctr run --runtime-config` (by removing that option).

This contains https://github.com/containerd/containerd/pull/954 which was
causing some services to fail to start.

All previous uses of 15541037b9 are updated to
5749f2e9e6.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-07 09:38:10 +01:00
Justin Cormack
ad7770fbf9 Update containerd
Fixes boltdb copying issue which caused failures.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-06 22:10:12 +01:00
Magnus Skjegstad
ae56dd81c2 vsudd: add /pkg/vsudd with README and example yml
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-06-06 16:32:01 +01:00
Ken Cochrane
60d099176c Added AWS provider to metadata package
Signed-off-by: Ken Cochrane <kencochrane@gmail.com>
2017-06-01 16:44:58 -04:00
Justin Cormack
ad1d33255d Change mkimage to use two disks
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-01 14:41:32 +01:00
Ian Campbell
eaedbd454c Update containerd to 7fc91b05917e93d474fab9465547d44eacd10ce3
Update everything including the current
linuxkit/containerd:b1766e4c4c09f63ac4925a6e4612852a93f7e73b to the new
linuxkit/containerd:deaf5bf838bf7f131c2287ecff3ed9835b0497e2.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-31 17:05:24 +01:00
Justin Cormack
5bb90f166a Merge pull request #1934 from justincormack/default-ns-change
Default ns change
2017-05-30 16:20:38 +01:00
Rolf Neugebauer
8cbf7cb064 Merge pull request #1883 from ijc25/qemu-ga
Add a simple qemu guest agent package
2017-05-30 16:15:55 +01:00
Justin Cormack
d92e19f020 Update the yaml files with new builds
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-30 15:40:51 +01:00
Justin Cormack
d9aada88dc Update for new default namespaces
See https://github.com/moby/tool/pull/56

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-30 15:06:30 +01:00
Justin Cormack
08e211df44 Use the sinit conventions for init
This should make it easier to switch out `init` for other versions,
although the `getty` config still needs to be removed.

- use `/bin/rc.init` for start
- use `rc.shutdown` for stop
- make `rc.init` run other code.
- merge `containers` and `containerd` startup code

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-30 14:14:34 +01:00
Ian Campbell
497b07e57b Add a simple qemu guest agent package
We don't actually build it here, we just use the alpine package, which is
already included in the linuxkit/alpine base.

Can be instantiated with a service stanza such as:
  - name: qemu-ga
    image: "linuxkit/qemu-ga:e5fbcf55926f6e1a96b3e49a392e547e8be1022c"
    binds:
      - /dev/vport0p1:/dev/vport0p1

The only functionality I've tested is to report IP addresses to the host (e.g.
via `virsh domifaddr`).

The image is configured to use `/dev/vport0p1` by default. If your VM image is
using a different port number then you can either incorporate the rename into
the bind ("/dev/vport1p1:/dev/vport0p1") or override the command with:
    command: ["/usr/bin/qemu-ga", "-p", "/dev/vport1p1"]

The mdev tool appears to not create the symlinks which udev would provide
`/dev/virtio-ports/org.qemu.guest_agent.0` hence the need to hardcode the
potentially unstable `/dev/vportNp1`, `N` seems to depend on the number and
order of virtio devices in use. I don't know if it is possible to get mdev to
create these links. For reference the udev rule is:

    SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"

See https://wiki.libvirt.org/page/Qemu_guest_agent for more info on the guest
agent.

A suitable stanza is added to `projects/swarmd/swarmd.yml` since that is where
I am using it.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-30 13:59:35 +01:00
Rolf Neugebauer
ebc7bd181a pkg: Update the binfmt packages to use the Alpine base compiling
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-29 17:30:57 +01:00
Rolf Neugebauer
6d59041daa pkg: Update the metadata package to multi-stage build and alpine base
- Use the alpine base to compile the go program
- Use a multi-stage build

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-29 17:30:57 +01:00
Riyaz Faizullabhoy
cdd27f7758 Update other ymls with linuxkit org after signing off on all packages
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-26 14:50:49 -07:00
Rolf Neugebauer
37c5e6bffb pkg: Update open-vm-tools to new Alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 16:23:56 +01:00
Rolf Neugebauer
86a6635930 docs: Update documentation
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 16:23:56 +01:00
Rolf Neugebauer
157c07be15 pkg: Add config label to the swap package
Note this also removes 'net:host' and 'pid:host' as
this does not seem to be necessary.

Also update to latest Alpine base image.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 16:21:12 +01:00
Rolf Neugebauer
fbbfd7a1fe pkg: Add config label to the sshd package
Also update to latest Alpine base image.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 16:21:12 +01:00
Rolf Neugebauer
27c573ed2c pkg: Add config label to the node_exporter package
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 15:50:54 +01:00
Rolf Neugebauer
330ccdf0e2 pkg: Add config label to the openntpd package
Also update to latest Alpine base image.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 15:50:54 +01:00
Rolf Neugebauer
3aac2416ad pkg: Add config label to the mount package
Also update to latest Alpine base image.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 15:50:54 +01:00
Rolf Neugebauer
5484035af5 pkg: Add config label to the format package
Also update to latest Alpine base image.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 15:50:54 +01:00
Rolf Neugebauer
7915cae6bd pkg: Update the Alpine base for some of the packages
The remaining packages will be updated with subsequent commits
to also include the config label.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-26 15:50:54 +01:00
Justin Cormack
a1d96f23a9 Merge pull request #1898 from thebsdbox/open-vm-tools
open-vm-tools package
2017-05-26 15:32:01 +01:00
Riyaz Faizullabhoy
05f1c282d5 Update images that have been newly setup for signing to use content trust on push
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-05-25 11:06:08 -07:00
thebsdbox
58829874d1 open-vm-tools package/documentation
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-25 16:15:15 +01:00
Justin Cormack
b46084695f Add a mkimage package
This will replace the tools/mkimage-* Docker images.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-25 13:57:48 +01:00
Rolf Neugebauer
3dda372640 pkg: Add moby config label to the rngd package
While at it, also update the Alpine base to a newer version.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-23 15:55:40 +01:00
Rolf Neugebauer
5cbd2d1a9a pkg: Add moby config label to binfmt package
While at it also update to the newer Alpine base image

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-23 15:55:33 +01:00
Rolf Neugebauer
b9172f2dd6 pkg: Add moby config label to dhcpcd package
This specifies the capabilities and bind mounts the dhcpcd daemon
needs.

While at it also update the Alpine base image

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-23 15:55:33 +01:00
Rolf Neugebauer
a6d834ddf0 Merge pull request #1865 from justincormack/go-compile
more Go compile fixes
2017-05-21 11:18:45 +01:00
Rolf Neugebauer
4377ae3209 Merge pull request #1861 from justincormack/containerd-build
Update containerd
2017-05-21 11:13:07 +01:00
Justin Cormack
f7cc10890d Update sysfs in line with sysctl
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-20 11:05:59 +01:00
Justin Cormack
e4d7e0b90c Update alpine for sysctl, remove gitignore
Minor cleanup

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-20 11:02:12 +01:00
Justin Cormack
4b30328c74 Add label to sysctl image
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-19 22:05:15 +01:00
Justin Cormack
e12b5a36ba Convert sysctl to using linuxkit/alpine and nested build
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-19 14:23:06 +01:00
Justin Cormack
c6e5ff83e0 Update containerd
- use new Makefile flags to add our build flags correctly now
- restore `dist` for now as it is useful for testing still, for now

Will remove both `dist` and `ctr` once we have our own tool, but will add
them to dev container instead.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-19 11:51:13 +01:00
Rolf Neugebauer
6bea56c185 Update all YAML files to use the new packages
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
d2c32e2e38 pkg: Make Hub org/repository build time configurable
Update the Makefiles of the remaining packages.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
ab5bb75642 pkg: Use tini from alpine base in rngd
This makes the package slightly bigger as tini from Alpine
is not statically linked but removes the dependency on
./tools/tini

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
e950d6e2ac pkg: Roll the sshd package from linuxkit/alpine
Also convert it to a multi-stage build and make
the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
9f6578783b pkg: Roll the swap package from linuxkit/alpine
Also convert to a multi-stage build and make the
make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
add7b63276 pkg: Roll the openntpd package from linuxkit/alpine
Also make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
7270e125d4 pkg: Roll the mount package from linuxkit/alpine
Also make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
e255bf1bf5 pkg: Roll the format package from linuxkit/alpine
Also make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
f5024e4baf pkg: Roll the docker-ce package from linuxkit/alpine
Also make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
92b8d873bf pkg: Roll the dhcpcd package from linuxkit/alpine
The dhcpcd package only needs a basic alpine-baselayout and
dhcpcd. This reduces the size of the package from 4.3MB to 1.8MB.

Also make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
72c88872e6 pkg: Roll the init package from linuxkit/alpine
We only need the alpine-baselayout packe to run init. This also
removes the sha256 import from alpine:edge.

This also reduces the size of the init package by more than
50% to just 1.5MB.

Also make the HUB org/registry build time configurable.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Rolf Neugebauer
c1a873b489 pkg: Update most packages to new alpine base
Also make the HUB org/registry build time configurable
for these packages.

Others will be reworked in sub sequent commits.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-18 18:55:22 +01:00
Ian Campbell
5eee4c0607 pkg/runc: WORKDIR as first item in second stage
Works around https://github.com/moby/moby/issues/33176 and fixes #1807.

Updated al users of linuxkit/runc:2649198589ef0020d99f613adaeda45ce0093a38 to
this new build.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-12 19:23:27 +01:00
Justin Cormack
6a5f8099a4 Remove extra files from init
fix #1807

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 15:36:13 +01:00
Justin Cormack
589d4bff58 Remove some old .gitignore files
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 15:25:59 +01:00
Justin Cormack
716f60f226 Update containerd
This includes the bug fix that was causing output to be lost much
of the time.

fix #1660

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-11 10:11:18 +01:00
Ian Campbell
800badea42 metadata: Allow simple string keys
If a file is a simple string (as opposed to a map) then write it with the
default perms. This makes for slightly terser metadata when creating a simple
datafile.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 01:39:03 +01:00
Ian Campbell
8fd1a3cbdb metadata: Fix parsing of JSON
`ok` was not assigned when type casting to `map[string]interface{}` so the
subsequent check was testing a stale value.

Also, the error message upon failure had the wrong sense.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-10 17:37:45 +01:00
Justin Cormack
515b25d518 Do not make directories
These should now be in the image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-10 11:00:35 +01:00
Justin Cormack
9e879dc56a Update Docker to 17.05.0-ce
This includes nested build support so we can look at starting to dogfood.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 11:08:16 +01:00
Justin Cormack
61bbbf0808 Change containerd and runc to use multistage builds from new Alpine base
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 22:37:59 +01:00
Justin Cormack
b70ca67931 Remove dist tool from containerd
It is 20MB and we don't use it...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 21:12:12 +01:00
Justin Cormack
c73f9b3e6b Update containerd
My patch has been merged so may as well use upstream.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 21:10:54 +01:00
Rolf Neugebauer
725853f11d Update packages/tests to use the new tini package
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-08 16:46:47 +01:00
Rolf Neugebauer
662ed3ad1f pkg: Remove c-compile from init
There is no need for start-stop-daemon since this package
is using containerd. Remove it and update the init
package to alpine:edge

Also use the git tree hash for the package hash while at it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-08 16:46:47 +01:00
Rolf Neugebauer
41b7861bac pkg: Remove c-compile from rgnd
Directly install the required packages from the Alpine base
image to compile the rngd package.

Also use the git tree hash for the package hash while at it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-08 16:28:39 +01:00
Rolf Neugebauer
98a8be0087 pkg: Update packages to new version of the alpine base image
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-08 16:28:39 +01:00
Rolf Neugebauer
17adcefe6c pkg: Convert openntpd to use the Alpine base image and git tree hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Rolf Neugebauer
41a1d16694 pkg: Use git tree hash for the prometheus node_exporter
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Rolf Neugebauer
1748a69f2a pkg: Convert mount to use the Alpine base and git tree hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Rolf Neugebauer
fce13fb48d pkg: Convert format to use the Alpine base and git tree hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Rolf Neugebauer
43d97967ef pkg: Convert docker-ce to use the Alpine base and git tree hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Rolf Neugebauer
e929205c31 pkg: Convert dhcpcd to use the Alpine base image and git tree hash
This builds the dhcpcd package from a fixed Alpine 3.5 base and adds
the dhcpcd daemon from the Alpine base image. This should make the
build reproducible and allows us to use the git tree hash.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Rolf Neugebauer
aea6d6c54e pkg: Convert binfmt to use the Alpine base image and git tree hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-04 22:27:59 +01:00
Justin Cormack
26f7d6ebdd Update ca-certificates to use new Alpine base image
This is what the other images should look like in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-03 16:42:28 +01:00
Justin Cormack
a37fd19f88 Adjust docker-ce package
Bring it into line with official images: remove `jq`, `sfdisk` which
are not needed; we used them for disk mounting but this is down standalone.
Add the tools for other filesystems, which are needed for `dm`, `btrfs`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-02 14:37:04 +01:00
Avi Deitcher
aebd255755 Add support for encrypted swap
Update examples/swap.yml to use latest linuxkit/swap image
Add comment to examples/swap.yml how to enable encryption
Add encrypt options to README
Make encrypted swap the default

Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-04-30 11:07:56 +03:00
Avi Deitcher
f72a2e7bef use updated kernel and correct path in examples/swap.yml
for swap.sh, take any command-line options, not just those with an arg
that in turn requires a new hash on the example

Use latest 4.9.x kernel to keep in line with other examples

Replace (bash) herestring with (posix) heredoc in swap.sh, and update hash to match

Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-04-29 22:18:42 +03:00
Justin Cormack
98dfe7ad55 Merge pull request #1721 from riyazdf/more-signing-targets
Signing targets for binfmt, rngd, compilers, toybox, tini
2017-04-27 18:53:49 +01:00
Riyaz Faizullabhoy
2c4c55859f Add separate sign-tag target, keep tool building offline
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-27 10:34:40 -07:00
Justin Cormack
dae0e4efae Fix typo "ndodev"
Not sure when this arrived but it was stopping anything running.
Appears not to be in the older test `init` containers.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-27 18:01:05 +01:00
Riyaz Faizullabhoy
38ad84bfbd pull base images with content trust for binfmt, rngd, tini, toybox-media
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-26 14:28:30 -07:00
Justin Cormack
1cd201aac5 Merge pull request #1715 from deitch/swap-module
First cut of swap image and example
2017-04-26 21:47:54 +01:00
Avi Deitcher
715cfbd02c First cut of swap image and example
Signed-off-by: Avi Deitcher <avi@deitcher.net>

Fix spaces after commas

Remove MAINTAINER

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Simplify swap.yml example to remove files section

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Switch swap.sh to sh from bash and remove bash from image

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Replace fallocate with dd and update calculation function to support it

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Fix indentation

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Change link to swap to just swap.sh

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Fix indent

Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-04-26 23:05:45 +03:00
Riyaz Faizullabhoy
78a0d018c1 enable DCT in buildchain for compiler images
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-26 12:09:33 -07:00
Riyaz Faizullabhoy
72e7945ec6 Add signing targets for binfmt, c-compile, go-compile, rngd, tini, toybox-media
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-26 10:55:20 -07:00
Justin Cormack
713046e158 Update ca-certificates to be based on Alpine and use nested build
We were using Debian but Alpine more consistent. Use nested build.

Currently extract the hash in a nasty way but this can be fixed later
when we switch over hashing method.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-26 15:24:26 +01:00
Justin Cormack
98159fd13f Merge pull request #1708 from rneugeba/binfmt
Move binfmt to a multi-stage build
2017-04-26 12:19:09 +01:00
Rolf Neugebauer
c6416ddecb pkg: Use multi-stage builds for the binfmt package
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-25 14:54:54 +01:00
Ian Campbell
20cfa2af2c Switch fallback hostname to linuxkit-* from moby-*
This was missed when things were renamed.

The intention with this code was (apparently) to provide a (pseudo)unique
hostname in the case where something more specific was not provided (e.g. by
DHCP). Make this a little clearer by using '(none)' rather than 'linuxkit' as
the default, in the normal case this will be overwritten by something more
specific and if it isn't we will change it to something somewhat unique derived
from the MAC address (as before). nb: '(none)' is already used by Debian so I
think it is a safe choice as the sentinel value.

The use of both CONFIG_DEFAULT_HOSTNAME and the explicit /etc/hostname from
mkimage.sh is likely to be redundant in some cases, but neither seems to
completely cover all cases so keep both.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-25 14:09:38 +01:00
Rolf Neugebauer
8d1eb49fa7 pkg: Convert rngd to a multi-stage build
This allows us to get rid of the ./base/rng-tools

Use c-compile to compile it

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-24 18:41:27 +01:00
Rolf Neugebauer
85bcee93dd tools: Move tini to ./tools and convert to multi-stage build
Previously the "tini" contained the entire build. Using the
multi-stage build creates a new "tini" base image, which only
contains the "/bin/tini". This image can be used as the base
image for packages requiring "tini".

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-24 18:41:27 +01:00
Justin Cormack
d616cea3e1 Enable Prometheus metrics on port 13337 on containerd
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-16 10:43:44 -05:00
Rolf Neugebauer
856a2651b0 pkg: Add a Prometheus node_exporter package
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-16 09:43:40 -05:00
Justin Cormack
e79e3a38ad Use containerd to run containers
Because we are not yet using the image store, this requires a
patched `ctr` that can run a specified rootfs rather than an
image.

We will switch to the image store later, but this requires
extensive build changes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-14 15:35:29 -05:00
Justin Cormack
72c3f9cfa2 More renames to LinuxKit
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-14 11:47:24 -05:00
Riyaz Faizullabhoy
3d91a7be86 Bump go-compile with ineffassign
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-12 16:54:51 -07:00
Rolf Neugebauer
0a0786d49e pkg: Update packages to push to linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Rolf Neugebauer
e7314ff350 pkg: Use images from linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Rolf Neugebauer
36749ea5c4 build: Switch using c-compile from linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Rolf Neugebauer
a06e6bbb37 build: Switch using go-compile from linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Rolf Neugebauer
105cb48ad6 metadata: Simplify the GCP SSH code
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 16:19:24 +01:00
Rolf Neugebauer
432bdda272 pkg: Remove metadata-gcp
It's no longer used

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 15:42:48 +01:00
Rolf Neugebauer
a21c566777 metadata: Make sure the ssh directory exists before writing to it
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 15:39:08 +01:00
Rolf Neugebauer
ce52c28cf6 metadata: Write the provider to /var/config/provider
This will be useful for testing.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 15:39:08 +01:00
Rolf Neugebauer
b0a0b4ceb7 metadata: Make JSON parser more robust
Make sure the type conversions are OK.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 15:39:08 +01:00
Rolf Neugebauer
626f02def2 metadata: Improve logging
Implementing a String() interface for each provider makes it
easier for users to prefix log strings with the provider.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 15:39:08 +01:00
Justin Cormack
3c326bebdf Make / rshared
Previously only `/var` was `rshared` but some people need to share
mounts in `/opt` etc so let us make everything `rshared` for now.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-12 13:10:46 +01:00
Rolf Neugebauer
9cf63a4aaa Merge pull request #1584 from rneugeba/userdata
pkg: Add a generic metadata package
2017-04-11 15:45:34 +01:00
Rolf Neugebauer
766e1d95d3 pkg: Add a generic metadata package
This package handles meta and user data for different cloud
and other platforms. It should be easy to extend to new
platforms.

Currently, it handles GCP metadata and a simple CDROM userdata
provider.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-11 15:32:17 +01:00
Justin Cormack
2c7628c101 Support dhcpcd in one shot mode as well
This is needed for cloud environments that want to get their metadata in
the onboot phase over the network.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-11 14:58:57 +01:00
Justin Cormack
a3ec9e86df Add openntpd container
Added to Docker example as Swarm mode likes time sync.

Note uses pool.ntp.org at present, on some providers it
should use a different source.

Constraints not enabled as they seem to have an issue;
possibly trying to set before network is up.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-10 20:32:59 +01:00
Justin Cormack
3afe494ae9 Merge pull request #1567 from justincormack/sysfs
Add a sysfs container and fix memory hierarchy
2017-04-10 17:59:37 +01:00
Justin Cormack
bc23fde1c2 Use the real default containerd toml config
Rather than an empty one.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-10 16:25:13 +01:00
Justin Cormack
0ffc2867a9 Use hierarchy for memory cgroups
Container systems expect this...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-10 14:36:06 +01:00
Justin Cormack
821fdaecc8 Remove SELinux setup until actually implemented
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-10 14:35:07 +01:00
Justin Cormack
efd1efe531 Add a sysfs container
However, do not try to change memory cgroups from it; this needs to be in `init`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-10 14:33:38 +01:00
Justin Cormack
9ee52aa966 Rework how /var is mounted
Instead of mounting a new filesystem, revert to doing a `rw` bind.

However do not make `/` `rshared`, just `/var` as that is where we expect
filesystems to be mounted for persistence. Also only make the actual
container rootfs writeable, not the whole directory.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-10 11:28:00 +01:00
Justin Cormack
bfa76205d5 Change propagation for root
- make / rshared
- make /containers private
- make /var its own tmpfs mountpoint, shared

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-09 13:50:04 +01:00
Justin Cormack
3ffa912c41 Move mount back to its own package, not inside docker
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-09 12:53:46 +01:00
Justin Cormack
e0aced6be0 Merge pull request #1550 from justincormack/rootfs-mountpoint
Make each rootfs a mountpoint by binding
2017-04-09 09:52:23 +01:00
Justin Cormack
fb5d6a8fad Add an (empty) config file for containerd
It needs one now.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-08 21:38:31 +01:00
Justin Cormack
c40351a0a8 Make each rootfs a mountpoint by binding
Otherwise shared mounts do not work correctly with `runc`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-08 21:10:30 +01:00
Justin Cormack
eb22d6909f 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
Ilya Dmitrichenko
a3638a2b8f Make sshd example usefull for debugging
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2017-04-08 12:49:51 +01:00
Justin Cormack
a54a694772 Split out init to have standalone runc, containerd
Also add ca-certificates to base, needed to use `dist` to pull.

Make two stage builds for `containerd` and `runc` so they have a
from `scratch` second stage.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-07 16:25:18 +01:00
Thomas Gazagnaire
226d394d15 update runc to version ac50e77bbb440dcab354a328c79754e2502b79ca
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-07 11:46:34 +02:00
Riyaz Faizullabhoy
8ba64546eb Remount rootfs as read-only after init, /var and /containers mounted as
read-write

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-06 09:30:46 -07:00
Justin Cormack
485452d9bd Merge pull request #1460 from justincormack/automount
Add a formatting container and persistent disk support for docker
2017-04-06 16:08:20 +01:00
Justin Cormack
0a030dc219 Clean up dhcpcd container
It is not necessary to bring up `eth0`, the program does it fine.

This means we can remove shell script, clean up build.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-06 15:32:22 +01:00
Justin Cormack
cf7b952995 Add persistent drive support to Docker container
This works and runs containers now, if you eg `runc exec` into it.
Needs a few tweaks for rlimits, but will pull and run containers.

Will integrate better with ssh/dev containers to make more usable.

For a simple test use
```
./bin/moby build examples/docker.yml
./bin/moby run hyperkit -disk-size 100 docker

```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-06 14:25:42 +01:00
Justin Cormack
8bcb2c9e0e Add a formatting container
This is based on the code we used for Docker Editions, and
will format an external drive, to be used for example for
`/var` for Docker image persistence.

It does not `mount` the drive yet, as splitting format and mount
gives better modularity.

Example yaml fragment:
```
  - name: format
    image: "mobylinux/format:097d4f22b20f976b1f89d8f0b8a5d074d35b856c"
    binds:
     - /dev:/dev
    capabilities:
     - CAP_SYS_ADMIN
     - CAP_MKNOD
```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-06 13:19:46 +01:00
Ian Campbell
2b54e18f9f Drop unnecessary use of start-stop-daemon with containerd.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-06 09:34:38 +01:00
Ian Campbell
8270bdfe33 Use exec in a couple of places to avoid needless lingering /bin/sh processes
```
$ apk -U add procps
$ ps xf
    1 ?        Ss     0:05 /sbin/init
  357 ?        Ss     0:00 /bin/sh /etc/init.d/containerd
  359 ?        Sl     0:00  \_ /usr/bin/containerd
  360 ?        Ss     0:00 /bin/sh /etc/init.d/containers
  432 ?        Sl     0:00  \_ /usr/bin/runc run --bundle /containers/daemon/swa
  466 ?        Ssl    0:00  |   \_ /usr/bin/swarmd --containerd-addr=/run/contai
  427 ?        Sl     0:00  \_ /usr/bin/runc run --bundle /containers/daemon/dhc
  457 ?        Ss     0:00  |   \_ bin/sh /usr/local/bin/start_dhcpcd.sh
  474 ?        S      0:00  |       \_ /sbin/dhcpcd --nobackground
  429 ?        Sl     0:00  \_ /usr/bin/runc run --bundle /containers/daemon/rng
  576 ?        Ss     0:00      \_ /bin/tini /usr/sbin/rngd -f
  580 ?        S      0:00          \_ /usr/sbin/rngd -f
```

becomes

```
$ ps xf
    1 ?        Ss     0:06 /sbin/init
  358 ?        Ss     0:00 /bin/sh /etc/init.d/containers
  426 ?        Sl     0:00  \_ /usr/bin/runc run --bundle /containers/daemon/dhc
  458 ?        Ss     0:00  |   \_ /sbin/dhcpcd --nobackground
  431 ?        Sl     0:00  \_ /usr/bin/runc run --bundle /containers/daemon/swa
  460 ?        Ssl    0:00  |   \_ /usr/bin/swarmd --containerd-addr=/run/contai
  428 ?        Sl     0:00  \_ /usr/bin/runc run --bundle /containers/daemon/rng
  574 ?        Ss     0:00      \_ /bin/tini /usr/sbin/rngd -f
  578 ?        S      0:00          \_ /usr/sbin/rngd -f
  356 ?        Ssl    0:00 /usr/bin/containerd

```

Specifically these are gone:
  357 ?        Ss     0:00 /bin/sh /etc/init.d/containerd
  457 ?        Ss     0:00  |   \_ bin/sh /usr/local/bin/start_dhcpcd.sh

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-04-06 09:34:38 +01:00
Riyaz Faizullabhoy
a33b9ff4b1 dhcpcd system container
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-04 08:23:47 -07:00
Ian Campbell
709402d780 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
Ian Campbell
31e0a848e1 pkg/init: ruinc and containerd binaries depend on Makefile
Since Makefile contains the hashes we need a dependency otherwise changing the
hashes does not necessarily result in the binaries getting updated.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-03-30 17:20:59 +01:00
Rolf Neugebauer
eac2fdd88d init: Enable tty? as console
Enable tty0 and friends as console and start getty on them.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-28 10:46:58 +01:00
Justin Cormack
7b79053306 Update containerd to current master
- now supports image pull and run end to end
- update runc to last version before spec update fix #1302
- remove ext2 utils from init

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-25 18:15:52 +00:00
Justin Cormack
905636d642 Move installable packages to pkg
Still leaves some intermediate repos in `base/`

See #1266

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-22 12:33:11 +00:00
Justin Cormack
e643f4a454 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
159202416c 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
4797088ec0 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