Commit Graph

550 Commits

Author SHA1 Message Date
Avi Deitcher
46ef83c979 Merge pull request #3702 from deitch/alpine-314
bump alpine to 3.14, remove go version hack
2021-11-16 14:56:01 +02:00
Avi Deitcher
58813e8791 bump go-containerregistry and manifest-tool to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-11-09 18:48:06 +02:00
Avi Deitcher
260cc85b52 Update package tags
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-11-09 14:02:43 +02:00
Avi Deitcher
bcbabcac28 Update use of test packages to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-11-09 14:02:41 +02:00
Avi Deitcher
897d7a5071 Update use of tools to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-11-07 16:40:26 +02:00
Avi Deitcher
e1dd1af1b9 extract more hard-coded yaml
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-11-05 13:07:06 +02:00
Avi Deitcher
0660ace86f extract hard-coded default image builders into file
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-11-04 14:51:15 -04:00
David Scott
f5f5dce318 linuxkit: fix pkg build on Windows
Previously when we set `cmd.Stderr = os.Stderr`, the stderr from buildx
would be mixed with the image tar, corrupting it.

Work around this (Windows-specific) problem by adding an explicit
indirection via a io.Pipe()

Signed-off-by: David Scott <dave@recoil.org>
2021-10-29 12:01:35 +01:00
David Scott
e8f8a409e8 Update hashes for pkg/init
Signed-off-by: David Scott <dave@recoil.org>
2021-10-26 19:52:22 +01:00
David Scott
d4c6ab742b Update hashes for pkg/...
Signed-off-by: David Scott <dave@recoil.org>
2021-10-18 21:02:44 +01:00
David Scott
380f36cc1a runc: don't mount /dev with ro
After runc 1.0.0-rc92 mounting /dev with ro will fail to start the
container with an error trying to `mkdir /dev/...` (for example
`/dev/pts`). This can be observed following the runc example

Comparing our `config.json` with the working one generated by
`runc spec`, both have a readonly rootfs (good) but the `runc spec`
one does not set `ro` in the `/dev` mount options.

This patch fixes readonly onboot containers by removing the "ro"
option from `/dev`, to match the `runc spec` example.

Signed-off-by: David Scott <dave@recoil.org>
2021-10-18 21:00:04 +01:00
Rolf Neugebauer
0dd8086d39 Update YAMLs to latest runc/containerd/test-containerd
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2021-10-16 16:57:15 +01:00
David Scott
46ea02f65b moby: device "all" will add to the cgroup whitelist
After the runc security advisory[1] the default cgroup device
whitelist was changed.

In previous versions every container had "rwm" (read, write, mknod)
for every device ("a" for all). Typically this was overridden by
container engines like Docker. In LinuxKit we left the permissive
default.

In recent `runc` versions the default allow-all rule was removed,
so a container can only access a device if it is specifically
granted access, which LinuxKit handles via a device: entry.

However it is inconvenient for pkg/format, pkg/mount, pkg/swap
to list all possible block devices up-front. Therefore we add the
ability to grant access to an entire class of device with a single
rule:

```
- path: all
  type: b
```

Obviously a paranoid user can still override this with a specific
major/minor number in a device: rule.

[1] https://github.com/opencontainers/runc/security/advisories/GHSA-g54h-m393-cpwq

Signed-off-by: David Scott <dave@recoil.org>
2021-10-14 16:14:21 +01:00
David Scott
24db42dd68 moby: add a Devices array to the image yml
According to https://github.com/linuxkit/linuxkit/pull/3684#issuecomment-860128095

runc removed the console as a default device, so now it must be specified
explicitly in the OCI config.

See 60e21ec26e

The similar code in moby/moby is here: https://github.com/moby/moby/blob/master/oci/devices_linux.go

This patch allows packages to declare a `devices` array, which can contain `/dev/console` etc.

Signed-off-by: David Scott <dave@recoil.org>
2021-10-14 16:14:05 +01:00
David Scott
c779e894da Fix linuxkit run qemu on macOS on Apple Silicon
Signed-off-by: David Scott <dave@recoil.org>
2021-10-13 14:38:20 +01:00
Avi Deitcher
ebbb1281f3 one-more
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-06-23 13:40:55 +03:00
Avi Deitcher
a05b0ac923 check for arch when pulling to cache, push by descriptor
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-06-21 23:33:34 +03:00
Avi Deitcher
873f61e695 bump manifest-tool to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-06-15 20:28:44 +03:00
Avi Deitcher
df36b7aa7d Push arch-specific tags, always build index from registry
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-06-10 13:33:16 +03:00
Dave Tucker
6312d58032 Merge pull request #3659 from edvinerikson/fix-install
fix: make command
2021-05-26 14:27:52 +01:00
Dave Tucker
452910c625 Makefile: Don't encode bindir in the tar archive
Prior to this commit we go build -o bin/foo, archive it, and
expand the archive, leaving the resulting artifact in bin.

This doesn't allow us to easily change the bin directory, or
move parts of the makefile around to make things more modular.

This commit changes the behaviour to:
go build -o foo, archive it, expand to `bin`

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-05-26 11:18:41 +01:00
Avi Deitcher
4795c993ee Add support for cache export
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-05-26 13:13:37 +03:00
Roman Shaposhnik
378cfc0b3d Allowing linuxkit to recongnize linux/riscv64 arch
Signed-off-by: Roman Shaposhnik <rvs@zededa.com>
2021-05-19 12:34:07 -07:00
Avi Deitcher
f7ee51d931 add v1tarreader for images and use it for docker load
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-05-18 18:14:23 +03:00
Avi Deitcher
ebf570d045 refactor buildContext into a simple stdin reader
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-05-18 18:14:23 +03:00
Avi Deitcher
dd09b7d77a simplify nobuild/force/build logic
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-05-18 18:14:22 +03:00
Edvin Eriksson
f4c4ab1c8c fix: install linuxkit in top-level bin folder
Signed-off-by: Edvin Eriksson <edvin.erikson@leovegas.com>
2021-05-07 14:22:15 +02:00
Avi Deitcher
31ed260e4a Build or push multiple packages at once
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-05-05 16:52:27 -04:00
Dave Tucker
0320678133 build: Add --skip-platforms flag
This adds a --skip-platforms flag that can be used with
lkt pkg build to ignore any arch specified in build.yml

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-05-02 17:31:27 +01:00
Dave Tucker
54185c8a3f pkglib: Rename v1 to registry
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-05-02 17:30:59 +01:00
Dave Tucker
981fb7ff32 pkglib: Add missing comment to FullTag
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-05-02 17:30:53 +01:00
Dave Tucker
907dc5394b pkglib: Don't error on platform mismatch
This prevents override of the platform by the user.
lkt pkg build --platform=linux/amd64 pkg/bpftrace should
attempt to build that package for that arch even though
it is not in the build.yml

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-05-02 12:28:43 +01:00
Avi Deitcher
58136486c6 Merge pull request #3646 from deitch/canonicalize-names
always use canonical names in the linuxkit cache
2021-04-30 16:55:48 +03:00
Avi Deitcher
9bb26e4c3a always use canonical names in the linuxkit cache
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-30 15:12:39 +03:00
Dave Tucker
93ada489f9 make: Fix for local builds outside of GOPATH
Go can be weird about tools having to run in a directory with
go.mod. This commit moves the linuxkit makefile to the same
directory as the code.

It also changes the semantics of the local-build target.
You can now use STATIC=0 for dynamic builds or PIE=1 to
use --buildmode=pie. The binaries we were producing in
local-static weren't actually static so I fixed that too

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-04-30 09:31:00 +01:00
Rolf Neugebauer
f37ae83839 Merge pull request #3638 from deitch/use-cache
handle image already in cache
2021-04-28 23:19:51 +01:00
Avi Deitcher
1fb7ff9af2 Update package tags
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-28 14:18:47 +03:00
Avi Deitcher
711720e0d5 Update use of test packages to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-28 09:12:07 +03:00
Avi Deitcher
911a0de14c handle image already in cache
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-28 09:09:09 +03:00
Avi Deitcher
8576579f60 Update use of tools to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-27 19:52:35 +03:00
Avi Deitcher
a82fff6377 Merge pull request #3612 from deitch/cross-build
cross build packages
2021-04-21 14:55:51 +03:00
Avi Deitcher
c8ef7d0eb0 cross build packages
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-21 13:03:26 +03:00
Avi Deitcher
74c7de7977 use correct manifest name when pushing
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-20 11:42:16 +03:00
Dave Tucker
561ce6f4be Remove Notary and Content Trust
This commit removes Notary and Content Trust.
Notary v1 is due to be replaced with Notary v2 soon.
There is no clean migration path from one to the other.
For now, this removes all signing from LinuxKit.
We will look to add this back once a new Notary alternative
becomes available.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2021-03-30 14:51:11 +01:00
Avi Deitcher
9633d23d37 write to cache
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-02-12 16:18:21 +02:00
Avi Deitcher
f8f214110b switch to go modules
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-01-18 20:46:52 +02:00
Avi Deitcher
0b7502f130 pull and cache images locally without docker
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2020-12-30 18:27:02 +02:00
Avi Deitcher
a37c0f48e1 Replace copied code with manifest-tool library
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2020-12-18 08:25:08 +02:00
Avi Deitcher
4ceaf86416 fix lint issue
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2020-12-07 18:04:57 +02:00
Avi Deitcher
9fe09dbba8 bump manifest-list to latest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2020-11-27 01:13:13 +02:00