Commit Graph

111 Commits (61ff7dfcdd06f90743f66865dda73f662bfba24b)

Author SHA1 Message Date
Akihiro Suda aabfa3b84a
Merge pull request #324 from ijc/readonly-rootfs-execop
Make llb.ReadonlyRootFS usable with common container images
2018-04-04 11:43:44 +09:00
Ian Campbell d9b64588cb Regenerate protobuf go file with gogoproto v0.5
This matches the version in vendor.conf, the previous version was `v0.5~25`
according to `git describe`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-04-03 13:45:50 +01:00
Ian Campbell 2e6adc027d Reduce code duplication with a closure.
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-04-03 11:13:15 +01:00
Ian Campbell ddae5a6ea4 Make llb.ReadonlyRootFS usable with common container images
e.g. with busybox image:

    OCI runtime create failed: container_linux.go:348:
    starting container process caused "process_linux.go:402:
    container init caused \"rootfs_linux.go:58:
    mounting \\\"proc\\\" to rootfs \\\"/.../rootfs\\\" at \\\"/proc\\\"
    caused \\\"mkdir /.../rootfs/proc: read-only file system\\\"\"": unknown

This is because we were setting the underlying snapshot readonly so the various
mountpoints (here /proc) cannot be created. This would not be necessary if
those mountpoints were present in images but they typically are not.

The right way to get around this (used e.g. by `ctr`) is to use a writeable
snapshot but to set root readonly in the OCI spec. In this configuration the
rootfs is writeable when mounts are processed but is then made readonly by the
runtime (runc) just before entering the user specified binary within the
container.

This involved a surprising amount of plumbing.

Use this new found ability in the dockerfile converter's `dispatchCopy`
function.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-04-03 11:04:07 +01:00
Ian Campbell ac6598d255 Check that mounts always have a target.
Otherwise the daemon panics when generating the OCI spec.

For belt and braces check in the ExecOp Run function but also when generating the spec.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-22 12:05:12 +00:00
Akihiro Suda ecf2e8dbc9 llb: update docs
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-27 16:06:01 +09:00
Tonis Tiigi 7906fb3085 vendor: update containerd to v1.0.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-13 16:00:09 -08:00
Vincent Demeester 79e346f59a
Add deadcode to the linter
it tends to help keeping uneeded code out O:)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-01 17:59:04 -08:00
Tonis Tiigi 6e40e83d35 Remove net/context dependencies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-17 09:11:22 -08:00
Tonis Tiigi 29b72a3912 solver: add some trace points
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-08 18:03:12 -08:00
Tonis Tiigi b94704e55c session: fix session closing and tracing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-08 18:03:06 -08:00
Tonis Tiigi d804819dad progress: fix skipping cached vertex progress
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-20 21:33:36 -08:00
Tonis Tiigi dd49b92fd1 solver: add simple locking to catch content duplicated
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-20 16:42:09 -08:00
Akihiro Suda 84c0dd0b07 worker: add labels
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-20 16:28:47 +09:00
Akihiro Suda dca082582e worker, solver: s/ResolveVertex/ResolveOp/g
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-19 13:20:30 +09:00
Akihiro Suda 21bebaea80 solver, worker: minor cleanup
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-18 16:20:59 +09:00
Tonis Tiigi efde4f2340 worker, solver: update interfaces
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-18 16:20:59 +09:00
Akihiro Suda a4316d16c7 solver: split llbop pkg
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-18 16:20:59 +09:00
Tonis Tiigi e58e6d1175 replace FollowSymlink with fs.RootPath
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-17 20:54:49 -08:00
Tonis Tiigi 2d3f36d359 source: add sharedkeyhint to local source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-15 15:13:15 -08:00
Tonis Tiigi 08e1c2990c dockerfile: add dockerignore support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-15 15:03:35 -08:00
Tonis Tiigi ad7c6a905c source: add function for parsing llb to identifier
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-13 16:43:49 -08:00
Akihiro Suda ead75c0d95 solver.mergeRemoteCache -> cache/instructioncache.Union
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-13 15:16:46 +09:00
Akihiro Suda 89450211fa *: deduplicate instructioncache definitions
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-13 15:03:14 +09:00
Akihiro Suda 29e5bef684 solver: split llbbridge to a separate file (TODO: separate pkg)
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-13 14:47:09 +09:00
Tonis Tiigi 7a5390f355 worker: add support for custom user
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-12 10:26:30 -08:00
Akihiro Suda c3aa849014 multi-worker daemon
- [X] put multiples workers in a single binary ("-tags containerd standalone")
- [X] add worker selector to LLB vertex metadata
- [X] s/worker/executor/g
- [X] introduce the new "worker" concept https://github.com/moby/buildkit/pull/176#discussion_r153693928
- [X] fix up CLI
- [X] fix up tests
- allow using multiples workers (requires inter-vertex cache copier, HUGE!) --> will be separate PR

Implementation notes:
- "Workers" are renamed to "executors" now
- The new "worker" instance holds an "executor" instance and its
related stuffs such as the snapshotter
- The default worker is "runc-overlay"

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-12-12 15:17:58 +09:00
Tonis Tiigi 438c850a16 dockerfile: add original command metadata to llb
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-07 16:13:50 -08:00
Tonis Tiigi 68165c07f4 exporter: allow exporting config with no snapshots
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-04 23:18:09 -08:00
Tonis Tiigi e0af9d1218 source: add more properties to http source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-04 12:00:46 -08:00
Tonis Tiigi 59628fb20f add http source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-02 19:52:15 -08:00
Tonis Tiigi 6c076f5d6a cleanup linter warnings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-11-16 18:09:35 -08:00
Akihiro Suda b888b38e5a solver: implement IgnoreCache LLB Metadata
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-11-07 03:40:07 +00:00
Tõnis Tiigi dfb786a292
Merge pull request #143 from AkihiroSuda/refactor-ref
cache, solver: refactor Reference interface
2017-11-06 14:39:15 -08:00
Akihiro Suda 565d08914f cache, solver: refactor Reference interface
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-11-06 06:30:16 +00:00
Tonis Tiigi 65dc07eb28 report imported cache lookup progress
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-15 20:41:47 +02:00
Tonis Tiigi 914ea2110b cache: include os/arch in cache checksum
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-15 19:04:53 +02:00
Tonis Tiigi 7171f5a27d cache: fix root snapshot cache lookup
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-15 19:00:23 +02:00
Tonis Tiigi 014a2dd8a1 cache: cache importing from a ref
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-13 15:38:08 -07:00
Tonis Tiigi 56e1f71e6b cache: allow pushing exported cache
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-13 15:37:55 -07:00
Tonis Tiigi 1b3f191b37 cache: base code for cache importing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-12 17:53:28 -07:00
Tonis Tiigi 8e611643f7 cache: export cache to content store
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-12 15:04:33 -07:00
Tonis Tiigi 0fd670fb73 solver: allow access to cached references for exporting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-12 11:23:42 -07:00
Akihiro Suda 0ee59e2bdf Merge pull request #137 from tonistiigi/contentmask
solver: replace contentkey with contentmask
2017-10-07 09:47:38 +09:00
Tonis Tiigi 2716524dee exclude selector from content based input hash
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-06 15:43:48 -07:00
Tonis Tiigi 53018a8113 solver: replace contentkey with contentmask
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-05 19:58:05 -07:00
Tonis Tiigi 59910481ca solver: make nested build use solverequest
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-05 17:51:04 -07:00
Tonis Tiigi 23a114a977 solver: simplify solver public api
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-05 10:05:38 -07:00
Tonis Tiigi 80bc5f6097 fix exporter attributes interface returns
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-03 21:14:13 -07:00
Tonis Tiigi 2809d01cf6 frontend: add gateway frontend / image frontend support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-03 21:14:03 -07:00