Commit Graph

614 Commits (072078a403ae4106f87f7225c7188f31ec8b6419)

Author SHA1 Message Date
Andy Caldwell cc1b7b56c7
Add test that global network is applied if otherwise unspecified
Signed-off-by: Andy Caldwell <andrew.caldwell@metaswitch.com>
2019-08-20 14:57:31 +01:00
Andy Caldwell 588c07f9b4
Set RunOptions rather than modifying solve state
Signed-off-by: Andy Caldwell <andrew.caldwell@metaswitch.com>
2019-08-18 21:45:47 +01:00
Andy Caldwell 5ea3a003f7
Implement support for RUN --network=none|default|host
Signed-off-by: Andy Caldwell <andrew.caldwell@metaswitch.com>
2019-08-17 01:44:46 +01:00
Tõnis Tiigi 48f4a9b00e
Merge pull request #1132 from tonistiigi/keep-git
git: updates for keep git dir
2019-08-14 14:10:52 -07:00
Tonis Tiigi f417bf2150 git: updates for keep git dir
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-14 13:28:42 -07:00
Tonis Tiigi c114e438f5 remotecache: fix inline cache in manifest lists
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-13 16:25:08 -07:00
Akihiro Suda 2b2bdac1b8
Merge pull request #1125 from tonistiigi/relative-ignore
dockerfile: ignore relative source paths for compatibility
2019-08-10 13:54:37 +09:00
Tonis Tiigi f3960acce1 dockerfile: ignore relative source paths for compatibility
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-09 10:46:35 -07:00
Tonis Tiigi 872bf0b8c8 dockerfile: add cap for detecting correct nooutput support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-08 22:07:34 -07:00
Tonis Tiigi 360a856527 ops: fix readwrite mounts it no output
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-08 22:07:30 -07:00
Tonis Tiigi 96b6a28312 exporter: allow oci exporters visibility to response metadata
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-31 10:21:19 -07:00
Tibor Vass a2b7cf8379
Merge pull request #1095 from tonistiigi/workdir-exists
executor: ignore workdir if already exists
2019-07-29 17:08:26 -07:00
Tonis Tiigi 1ac116289d dockerfile: allow required key only for secret/ssh mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-29 15:47:54 -07:00
Tonis Tiigi add2c8db8a dockerfile: allow required flag to take value
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-26 16:54:20 -07:00
Tonis Tiigi 2cd19dbc34 executor: ignore workdir if already exists
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-26 16:28:43 -07:00
Tibor Vass 4eb6eef150
Merge pull request #1094 from tonistiigi/cache-ns
dockerfile: set optional cache ID namespace with build-arg
2019-07-26 16:28:39 -07:00
Tonis Tiigi 26d5ebd184 dockerfile: set optional cache ID namespace with build-arg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-26 15:01:15 -07:00
Tonis Tiigi 6371e4a31f dockerfile: fix default cache IDs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-26 14:27:06 -07:00
Tibor Vass 4bba1b1f3d dockerfile: build args in history should honor env overrides
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-23 01:26:56 +00:00
Tibor Vass f4702ad490 dockerfile: move toEnvMap function to tests
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-23 01:26:56 +00:00
Tibor Vass a7e52bf76d dockerfile: fix handling of empty build-arg also used as env
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-23 01:26:56 +00:00
Tibor Vass 852765fa0b dockerfile: add test for empty build-arg also used as env
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-23 01:26:56 +00:00
Tonis Tiigi 69adb50902 hack: unbreak upgrade to buster
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-22 16:38:21 -07:00
Andrey Smirnov 86e19b621e Implement frontend support for RUN --security=insecure
Example:

    RUN --security=insecure cat /proc/self/status | grep CapEff
    #84 0.093 CapEff:	0000003fffffffff

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-07-19 01:01:42 +03:00
Tonis Tiigi 0cd68f6491 dockerfile: do not add linked and cache paths to context sources
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-11 17:11:59 -07:00
Tõnis Tiigi 21034f4234
Merge pull request #1064 from zabio3/using-rawstring-regex
Simplify regular expression by using raw string literal
2019-07-02 17:39:42 -07:00
Tonis Tiigi 717bb1d769 dockerfile: add test for formatting in env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-01 16:55:17 -07:00
zabio3 be2691d06c using raw string literal
regular expressions have their own escape sequences, raw strings can improve their readability.
Signed-off-by: Tomohiro Kusumoto <zabio1192@gmail.com>
2019-06-30 12:24:25 +09:00
Tonis Tiigi 0f1c7d0412 session: use errors cause
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-06-06 21:15:21 -07:00
Nathan Sullivan 7c2b06fae9 export parser endLine (make public). StartLine is already public.
https://github.com/moby/buildkit/issues/1028

Signed-off-by: Nathan Sullivan <nathan@nightsys.net>
2019-05-31 13:48:02 +10:00
Tonis Tiigi aed5e98d92 dockerfile: allow uid/gid in cache mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-22 11:20:15 -07:00
Tibor Vass f238f1efb0
Merge pull request #1002 from tonistiigi/cwd-user
executor: make sure cwd created with correct user
2019-05-13 11:22:23 -07:00
Tonis Tiigi ae6c887689 grpcclient: set timeout for ping request
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-11 22:42:19 -07:00
Tonis Tiigi 649f68aae2 gateway: handle grpc errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-11 22:42:19 -07:00
Tonis Tiigi 858b4c7076 executor: make sure cwd created with correct user
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-11 22:11:26 -07:00
Stepan Blyshchak ea4bb024df [convert_test] add ut for circular dependency cases in dockerfile
Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
2019-05-11 19:48:18 +03:00
Stepan Blyshchak 981ee38406 [convert] move 'stageName = ""' in covert after checking for circular dependency
To have stageName in error output in case one stage depends on itself

Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
2019-05-11 18:25:22 +03:00
Stepan Blyshchak 98a6ff4fe2 apply gofmt
Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
2019-05-11 18:25:22 +03:00
Stepan Blyshchak ad4ae59aa6 [dockerfile2llb] check for circular dependency in convert
Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
2019-05-11 18:25:22 +03:00
Tonis Tiigi dcacc3985b hack: fix csv values
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-26 16:58:28 -07:00
Tonis Tiigi bb03ee6873 dockerfile: allow subdirs for remote contexts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-25 22:27:43 -07:00
Tonis Tiigi 427e2f0a5f exporter: put arm variant in the image config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-22 18:01:30 -07:00
Tonis Tiigi 01f17243bb dockerfile: allow external dockerfile on remote context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-17 23:50:15 -07:00
Tibor Vass bcd466a748
Merge pull request #941 from tonistiigi/http-session
http: allow uploads from session
2019-04-16 18:21:54 -07:00
Tõnis Tiigi 776c838951
Merge pull request #926 from pptime/35018-expandchown
Expand chown value of COPY command
2019-04-16 00:34:46 -07:00
Tonis Tiigi 4b97a7fed0 dockerfile: use fileop for http context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-16 00:15:07 -07:00
Tonis Tiigi e4cb7b17f1 http: allow uploads from session
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-15 23:20:31 -07:00
Dave Chen 63771e60ec doc: make sure the intended message is redirected to file successfully
- suppress the irrelated warning message
- export `stderr` besides `stdout` to the output file

Signed-off-by: Dave Chen <dave.chen@arm.com>
2019-04-15 00:38:40 -07:00
Hao Hu 155bfa5a80 Test expanding chown value of COPY command
Signed-off-by: Hao Hu <hao.hu.fr@gmail.com>
2019-04-06 23:01:55 +02:00
Hao Hu 0248635269 Expand chown value of COPY command
Signed-off-by: Hao Hu <hao.hu.fr@gmail.com>
2019-04-06 10:53:05 +02:00
Tonis Tiigi 15ef4e2b8a dockerfile: allow content cache for rw mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-02 19:40:30 -07:00
Tibor Vass 29d65d206e
Merge pull request #921 from tonistiigi/tmpfs-readwrite
dockerfile: make tmpfs mount readwrite by default
2019-04-02 18:49:40 -07:00
Tonis Tiigi 502de0e0b4 dockerfile: make tmpfs mount readwrite by default
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-02 18:14:52 -07:00
Tonis Tiigi a6e29dcdd4 dockerfile: handle args with unset values
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-02 14:40:53 -07:00
Tonis Tiigi c1a1d7033d exporter: add tar exporter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-27 09:40:24 -07:00
Tibor Vass fe0b8a4ec7
Merge pull request #902 from tonistiigi/itegration-update
integration: generalize pkg
2019-03-26 16:35:12 -07:00
Tonis Tiigi 7e52b33bf8 integration: generalize pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-21 23:49:08 -07:00
Tonis Tiigi 7ac4bf072f dockerfile: add dockerignore override support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-21 23:09:09 -07:00
Tõnis Tiigi e0f5c984dd
Merge pull request #898 from chendave/deprecated2
Stop using the deprecated flag "--frontend-opt" for build
2019-03-20 22:43:16 -07:00
Dave Chen 28c9923fc1 Stop using the deprecated flag "--frontend-opt" for build
This patch replace "--frontend-opt" to "--opt" for the place
where it is appliable.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2019-03-20 19:04:14 -07:00
Tibor Vass 9e8dfa72d3
Merge pull request #885 from tonistiigi/content-gc
content: fix setting wrong gc labels on config query
2019-03-20 18:52:41 -07:00
Dave Chen c7ac2f392a Stop using the deprecated way for build
Signed-off-by: Dave Chen <dave.chen@arm.com>
2019-03-19 19:01:31 -07:00
Tonis Tiigi 2dc7a133a2 content: fix setting wrong gc labels on config query
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-18 12:00:09 -07:00
Akihiro Suda a67ba78d9e
Merge pull request #809 from tonistiigi/fileop
llb: fileop implementation
2019-03-18 10:07:10 +09:00
Akihiro Suda cd89a8ce3d go 1.12
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-17 04:38:23 +09:00
Tonis Tiigi 5effbff314 dockerfile: improve symlinks copy tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tibor Vass 6fd30e7b43 dockerfile: add more tests to fix fileop
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi c6149da2eb fileop: review fixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi f38d971b95 dockerfile: add matrix testing for non-fileop versions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi 637bec7196 dockerfile: make fileop default
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi c57e5b22ea dockerfile: add regression test for wildcard cache
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi c4ef668f62 dockerfile: regression test for existing dest dir perms
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi 369f7482de dockerfile: regression test for wildcard unpack
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi 39ba2ede04 dockerfile: regression test for workdir creation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi bb11c8c5c9 dockerfile: empty wildcard regression test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi 0d17ac323e fileop: updates with new fsutil copy pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:58 -07:00
Tonis Tiigi 8a4674bab4 fileop: add dockerfile support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-15 17:49:50 -07:00
Akihiro Suda 5c9f7b8ff0 buildctl: new CLI ("Option C+")
See https://github.com/moby/buildkit/pull/807#issuecomment-468146089

Close #774

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-06 13:20:21 +09:00
Tonis Tiigi 632797cef0 vendor: udpate fsutil to b4281fa
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-05 17:34:01 -08:00
Tonis Tiigi 62697a93f7 dockerfile: allow custom context names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-02-23 09:12:54 -08:00
Tibor Vass 175506ff7f hack: update scripts to be go mod compatible
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-01-31 22:44:47 +00:00
Tõnis Tiigi 7679d6fa7d
Merge pull request #795 from tonistiigi/fmt-fix
client: avoid string formatting on custom vertex names
2019-01-23 08:30:08 -08:00
Tonis Tiigi c0371c908f client: avoid string formatting on custom vertex names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-22 15:35:39 -08:00
Tonis Tiigi 03a2f79561 gateway: allow frontends without network
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-21 19:38:07 -08:00
Tonis Tiigi db3db1033d dockerfile: ensure metadata commands have created time
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-18 11:14:45 -08:00
Akihiro Suda 6e7617e889 support local cache exporter and importer
Export:

  $ buildctl build ... --export-cache type=local,store=/path/to/output-dir

Import:

  $ buildctl build ... --import-cache type=local,store=/path/to/input-dir

Impact on CLI:
* Old (deprecated but still effective): `--export-cache localhost:5000/myrepo:buildcache --export-cache-opt mode=max`
* New: `--export-cache type=registry,ref=localhost:5000/myrepo:buildcache,mode=max`

Impact on API:
* New fields are added to control.proto and gateway.proto. The daemon
internally translates old API calls to the new ones.
* While new API can be used for `registry` caches, the client continues
to use the legacy API for `registry` caches to ensure compatibility with
old daemons.
* To import `local` caches with a frontend, the frontend needs to support
a new frontend opt `cache-imports`.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-01-19 02:38:26 +09:00
Tõnis Tiigi 34ff9c2366
Merge pull request #771 from LinuxMercedes/error-on-empty-dockerfile
Have parser error on dockerfiles without instructions
2019-01-04 16:33:08 -08:00
linuxmercedes 2ec7d53b00 Parser errors on dockerfiles without instructions
See https://github.com/moby/moby/pull/38487 for more discussion.

Signed-off-by: Natasha Jarus <linuxmercedes@gmail.com>
2019-01-04 13:44:52 -06:00
Tonis Tiigi b521aae3ea dockerfile: allow setting file mode/uid for secrets
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-03 11:13:40 -08:00
Tonis Tiigi 2529762ae7 dockerfile: allow setting file mode/uid for ssh socket
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-01-03 11:13:34 -08:00
Tonis Tiigi 3926820e3a update dockerfile repo location
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-12-03 11:06:17 +01:00
Wei Fu 2a7287a189 dockerfile2llb/pipe: remove the useless assignment
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2018-11-28 19:44:53 +08:00
Tonis Tiigi 2e3058e62c dockerfile: allow symlinks on reading Dockerfile
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-11-20 18:15:41 -08:00
Tibor Vass bf8c057e68
Merge pull request #727 from tonistiigi/add-fix
dockerfile: avoid urls in context filter
2018-11-20 16:47:31 -08:00
Tonis Tiigi b3e4cdf0d8 dockerfile: document more mount options
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-11-19 10:10:10 -08:00
Tonis Tiigi c840e7967f dockerfile: avoid urls in context filter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-11-18 12:36:26 -08:00
Tonis Tiigi 9d3426d94f dockerfile: update image refs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-11-07 17:51:02 -08:00
Tonis Tiigi ec2ab81a3b dockerfile: update copy source repo
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-11-06 11:14:59 -08:00
Akihiro Suda b5003d53eb update docs
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-11-01 16:17:26 +09:00
Akihiro Suda 03d15c8ff2 bump up tonistiigi/copy to v0.1.9
Fix #704 (CoreOS xattr issue)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-31 13:30:26 +09:00
Tõnis Tiigi 85935a3d1e
Merge pull request #661 from tiborvass/dockerfile-shell-only-envvar
dockerfile: RUN's CustomName no longer consume quotes and only replaces environment variables if set
2018-10-29 11:04:07 -07:00
Tonis Tiigi 134e126aab dockerfile: add daily feature releases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-23 22:43:21 -07:00
Tõnis Tiigi 50b36877f5
Merge pull request #695 from tonistiigi/dockerfile-release
dockerfile: add release tag deployments
2018-10-22 17:41:12 -07:00
Tonis Tiigi 945e100a8c dockerfile: disable network for copy
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-22 13:23:10 -07:00
Tonis Tiigi 918ee1988a dockerfile: add release tag deployments
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-17 14:11:09 -07:00
Tonis Tiigi 4c3050a26c dockerfile: setup master release deployment
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-16 21:01:33 -07:00
Akihiro Suda 0d80bd17a3
Merge pull request #687 from tonistiigi/dockerfile-testing
dockerfile: add testing external dockerfile features
2018-10-16 15:58:55 +09:00
Tonis Tiigi 12513ba394 dockerfile: remove dfextall build tag
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-15 22:27:13 -07:00
Tonis Tiigi 74754d6a6a dockerfile: add example mount test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-15 22:27:13 -07:00
Tonis Tiigi 706fa2556a dockerfile: add testing external dockerfile features
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-15 22:27:07 -07:00
Akihiro Suda 048130d1d0 simplify rootless
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-16 14:05:58 +09:00
Tonis Tiigi 94a6c5c79d dockerfile: add test for empty copy directory
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-15 16:43:21 -07:00
Tonis Tiigi 1f51f5ea11 testutil: avoid excessive daemons in integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-11 16:47:35 -07:00
Tonis Tiigi af8b839283 dockerfile: fix empty dest directory panic
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-11 11:24:02 -07:00
Tonis Tiigi 2f8c7667d8 dockerfile: wrap reference parse error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-08 23:15:10 -07:00
Akihiro Suda ab6a2dc83e
Merge pull request #669 from tonistiigi/update-copy
dockerfile: update default copy image
2018-10-06 11:11:49 +09:00
Akihiro Suda 98e26e9685
Merge pull request #668 from tonistiigi/ssh-required-opt
dockerfile: fix ssh required option
2018-10-06 06:50:27 +09:00
Tonis Tiigi 48ec136f1b dockerfile: update default copy image
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-05 14:35:33 -07:00
Tonis Tiigi 079b429c12 dockerfile: fix ssh required option
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-05 14:10:09 -07:00
Ian Campbell 2ea0269ec4 gateway: check for `ReadDir` and `StatFile` caps on client side
This will produce a "requested feature is not supported" style error message
with some more specific details about the build server configuration rather
than a more generic gRPC "unsupported" error message.

Ensure that the tests pass the caps to `Marshal` so they see the new
functionality.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-05 15:20:50 +01:00
Tõnis Tiigi 520201006c
Merge pull request #665 from tiborvass/fix-dockerfile-load-output
dockerfile: change output when loading Dockerfile
2018-10-04 19:22:00 -07:00
Tibor Vass ef99a677c5 dockerfile: change output when loading Dockerfile
Previously, the output said "load Dockerfile from " + filename when the
file is not named Dockerfile. With this patch, it is changed to always
show "load build definition from " + filename.

This is because `# syntax = ...` can be put in non-Dockerfiles.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-10-04 20:52:15 +00:00
Ian Campbell b4454a169f implement `gateway.Reference.StatFile` method
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-03 12:16:45 +01:00
Ian Campbell df76f6d380 Move cache/fsutil into a separate cache/util subpackage
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-03 12:16:44 +01:00
Ian Campbell b30ee91a53 implement `gateway.Reference.ReadDir` method
The alternative is a helper container running e.g. find, capturing the output
to a scratch to be read back (with ref.ReadFile) and parsed.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-10-03 12:16:44 +01:00
Tõnis Tiigi c9dc8352a4
Merge pull request #656 from AkihiroSuda/cap-ssh
define CapMountSSH
2018-10-02 23:21:17 -07:00
Akihiro Suda 758a267235 s/CapMount/CapExecMount/g
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-03 15:03:36 +09:00
Akihiro Suda fa92effc4b dockerfile: add support for RUN --mount=type=ssh
* Needs to be compiled with `dfrunmount dfssh`
* Implemented options:
 * `type`(required): needs to be `ssh`
 * `target`(optional): the socket path in the container
 * `id`(optional): id

Test script:

	#!/bin/bash
	set -exu -o pipefail
	REF=localhost:5000/dfssh:latest
	ssh-add -l
	sudo buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=frontend/dockerfile/cmd/dockerfile-frontend \
	  --frontend-opt "build-arg:BUILDTAGS=dfrunmount dfssh" \
	  --exporter=image --exporter-opt name=$REF --exporter-opt push=true
	mkdir -p /tmp/foo
	cd /tmp/foo
	cat << EOF > Dockerfile
	# syntax=$REF
	FROM alpine
	RUN apk add --no-cache openssh-client
	RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
	RUN --mount=type=ssh ssh git@gitlab.com
	# "Welcome to GitLab, @GITLAB_USERNAME_ASSOCIATED_WITH_SSHKEY" should be printed here
	EOF
	sudo buildctl build --ssh default=$SSH_AUTH_SOCK --progress=plain --frontend=dockerfile.v0 --local context=. --local dockerfile=.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-03 14:53:43 +09:00
Tibor Vass b9859b2d49 dockerfile: RUN's CustomName no longer consume quotes and only replaces environment variables if set
```
FROM alpine
RUN echo "Hey $name"
```

When building the above Dockerfile, the RUN command used to show: `echo Hey `
With this patch it now shows `echo "Hey $name"`.

However, because it is very useful for debugging to see the values variables can take,
they are expanded if set.

```
FROM alpine
ENV name=Jude
RUN echo "Hey $name"
```

Building the above Dockerfile makes the RUN command show: `echo "Hey Jude"`.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-10-03 02:41:51 +00:00
Tonis Tiigi d40d557692 dockerfile: fix building dfextall
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-02 10:33:18 -07:00
Tibor Vass 38198bd5c3 dockerfile: substitute build args in addition to env vars in RUN's CustomName
Example Dockerfile:

 FROM busybox
 ARG foo=abc
 ENV bar=def
 RUN echo $foo $bar $baz

Output without fix:

 #5 [2/2] RUN echo  def
 #5       digest: sha256:647df948c9689163efaf92b24b38779bc9f8b350482ecc3de3533f86a544c196
 #5         name: "[2/2] RUN echo  def "
 #5      started: 2018-09-29 19:01:11.376665368 +0000 UTC
 #5 0.764 abc def
 #5    completed: 2018-09-29 19:01:12.320141054 +0000 UTC
 #5     duration: 943.475686ms

Output with fix:

 #5 [2/2] RUN echo abc def
 #5       digest: sha256:647df948c9689163efaf92b24b38779bc9f8b350482ecc3de3533f86a544c196
 #5         name: "[2/2] RUN echo abc def "
 #5      started: 2018-09-29 19:01:11.376665368 +0000 UTC
 #5 0.764 abc def
 #5    completed: 2018-09-29 19:01:12.320141054 +0000 UTC
 #5     duration: 943.475686ms

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-29 19:07:01 +00:00
Tonis Tiigi 25bfc57e9e dockerfile: add test for chown destination
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-25 23:10:17 -07:00
Tõnis Tiigi e04e16c836
Merge pull request #641 from tonistiigi/llb-caps-check
gateway: allow access to apicaps
2018-09-25 09:02:40 -07:00
Tonis Tiigi 895950cecf executor: fix submount symlink resolution
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-24 17:42:38 -07:00
Tonis Tiigi f6e104da5f gateway: allow access to apicaps
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-21 15:33:41 -07:00
Tonis Tiigi f6352a305f dockerfile: add symlink copy tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-21 13:16:57 -07:00
Tõnis Tiigi 39404586a5
Merge pull request #622 from tonistiigi/df-modes-switch
dockerfile: enable frontend selection in integration tests
2018-09-20 14:44:11 -07:00
Tibor Vass 9890dda814
Merge pull request #634 from tonistiigi/schema1-config-fix
imageutil: fix getting schema1 configs
2018-09-19 15:50:52 -07:00
Tonis Tiigi 7615f02078 dockerfile: avoid detecting schema1 configs as empty
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-19 14:09:37 -07:00
Tonis Tiigi 2ab0922500 dockerfile: enable frontend selection in integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-18 22:07:38 -07:00
Tonis Tiigi a75983ddb9 integration: pass mirrored images from test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-18 22:07:38 -07:00
Tonis Tiigi 0940cdc6fe update golint comments
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-18 22:06:47 -07:00
Tibor Vass 0cd2b56a52
Merge pull request #629 from tonistiigi/df-output-fix
dockerfile: improve output
2018-09-17 15:39:14 -07:00
Tonis Tiigi 3938aebdfc llb: make sure to use stable marshaler
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-17 15:19:04 -07:00
Tonis Tiigi 705b5f0a4a dockerfile: fix command count & platform for scratch stages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-17 13:42:25 -07:00
Tonis Tiigi 9c6eb52a84 dockerfile: avoid duplicate config resolve lines
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-17 13:42:21 -07:00
Tonis Tiigi b103d7fdd6 dockerfile: allow relative paths in mount targets
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-17 11:15:22 -07:00
Akihiro Suda bf571a519e update Go to 1.11
For consistency with Moby (moby/moby#37358)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-09-15 14:25:11 +09:00
Tonis Tiigi c1d0aa7c5a dockerfile: set default PATH for arg replacement
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-11 12:15:44 -07:00
Tõnis Tiigi 9a6e2a5a91
Merge pull request #607 from kunalkushwaha/fix-typo-1
function name fixed SetMarhalDefaults -> SetMarshalDefaults
2018-09-05 22:01:39 -07:00
Kunal Kushwaha 98c1f44151 function name fixed SetMarhalDefaults -> SetMarshalDefaults
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-09-06 13:28:39 +09:00
Akihiro Suda 756ca6cc6d
Merge pull request #602 from tonistiigi/gc
automatic GC
2018-09-05 10:47:21 +09:00
Tonis Tiigi 079c747c4e ontrol: support calling automatic GC
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-04 18:13:29 -07:00
Tibor Vass 6812dac65e
Merge pull request #596 from tonistiigi/required-secret
dockerfile: add required option for secrets
2018-09-04 08:05:41 -07:00
Tonis Tiigi 372528a565 dockerfile: update copy helper to v0.1.4
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-31 14:44:08 -07:00
Tibor Vass 94b009b27e
Merge pull request #594 from tonistiigi/override-copy
dockerfile: allow overriding copy image
2018-08-31 14:35:06 -07:00
Tõnis Tiigi e3bc522f7c
Merge pull request #582 from ijc/gateway-client-snapshot-leak
clientside-frontend: release non-result refs after completion
2018-08-31 09:22:28 -07:00
Tonis Tiigi 3eda0516da dockerfile: allow overriding copy image
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-30 13:21:52 -07:00
Ian Campbell 53921cf110 llbBridfgeForwarder: Drop refs as they are released in `Discard`.
This makes it safe(r) for `Discard` to be called more than once.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 15:23:49 +01:00
Ian Campbell b558d75d3a Consistently protect `llbBridgeForwarder.refs` with mutex
Most accesses to this map are protected. Add the missing locks (some of which
are in code paths where we wouldn't normally expect concurrent accesses, but
better to be safe).

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 15:03:29 +01:00
Ian Campbell 59391d1647 clientside-frontend: release non-result refs after completion
Tests such as TestNoSnapshotLeak were failing in client mode (e.g. using #522)
because we weren't releasing the intermediate refs.

Resolve this by refactoring the existing code which frees the intermediate refs
from `gatewayFrontend.Solve` into a method on `llbBridgeForwarder` and as well
as the original site also call from the solver when the top-level solve (in
clientside frontend mode) completes. The original call (which is via a defer)
could likely sensibly be moved either earlier or later if desired but leave it
here it is to minimise the scope of the change.

The previous code used the `retErr` named return but the code between that
point and the end of the function already ensured that `lbf.err` is the same as
`retErr`, thus the only change in the code which has moved is
`s/retErr/lbf.err/`. Note that the `res` named return was previously unused by
name.

Fixes #581.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-30 14:54:50 +01:00
Tibor Vass 17e6416706
Merge pull request #504 from kunalkushwaha/no-console
--no-progress replaced with --progress
2018-08-29 13:44:51 -07:00
Tonis Tiigi 6daf696f04 dockerfile: add required option for secrets
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-28 16:18:08 -07:00
Tonis Tiigi 38569b9b9a dockerfile: never use entrypoint for run commands
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-27 17:48:18 -07:00
Tonis Tiigi 4963ed7ea4 dockerfile: fix quoting of meta args
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-27 09:39:55 -07:00
Kunal Kushwaha 49c9f75275 --no-progress replaced with --progress
this make buildctl build output options same as moby.

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-08-27 11:23:15 +09:00
Akihiro Suda decb27618b containerd: set timeout explicitly (60s)
The contained default value was shortened from 60s to 10s in containerd/containerd#2554

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-08-23 18:14:57 +09:00
Akihiro Suda af46188e9b
Merge pull request #533 from ijc/client-gateway
access gateway API from client
2018-08-17 05:12:23 +09:00
Ian Campbell 22f632f895 allow frontends to be run directly on the control client side
This allows builder code to be written which can be built as either a gateway
container or in a purely client side configuration, giving implementors more
flexibility.

Now when `Solve` sees a request with neither a definition nor a frontend
specified it will make the job available via new LLBBridge endpoints on the
control socket which the client can then use. These end points require the job
id to be present in the gRPC metadata and a client side object is added to
facilitate this.

The `llbBridgeForwarder` type is now exposed as a public `interface
LLBBridgeForwarder` which satisfies the underlying gRPC server interface
(`pb.LLBBridgeServer`) as well as a new `Done()` & `Result()` pair which can be
used to wait for the client to call `Return()` (using a model similar to
`context.Context`).

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-14 11:50:08 +01:00
Tonis Tiigi 95e0348f57 dockerfile: enable global net-mode settings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-09 14:03:40 -07:00
Akihiro Suda 809b9a4602
Merge pull request #568 from tonistiigi/multi-platform
dockerfile: allow multi-target external builds
2018-08-10 00:09:35 +09:00
Ian Campbell 2a4ec0b192 gateway: call `Return` if call to `BuildFunc` returns an error.
Reorder the code slightly so that an error returned by the call to the
`BuildFunc` is picked up by the `defer`d error handling.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-09 11:19:42 +01:00
Ian Campbell 13f53d5753 gateway: tolerate `Solve` being called with no `creq.Definition`
Avoids panicing when accessing `creq.Definition.Metadata`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-09 11:19:42 +01:00
Ian Campbell 3f5276b3c4 gateway: make `Return` a one shot operation and check for various edge cases.
Refactor the setting/getting of the result for a `llbBridgeForwarder` in order
to check that `Return` is only called once and only with the correct options.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-09 11:19:42 +01:00
Ian Campbell 5485309658 gateway: Return an `interface` from `grpcclient.New`.
Returning an interface rather than a private-struct from a public interface is
good practice.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-09 11:19:29 +01:00
Tonis Tiigi fa83e55b21 dockerfile: allow multi-target external builds
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-08 18:42:43 -07:00
Tonis Tiigi 5e6729e56f dockerfile: implement secret type mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-08 18:12:16 -07:00
Ian Campbell 682dce615a gateway: support direct creation/running of a client.
Provide a `New` method and a new `Run` method on the `grpcClient` to allow
manual creation of a client in addition to the current ability to initialise
from the environment. Accordingly the existing `Run` method becomes
`RunFromEnvironment`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-08-08 10:17:32 +01:00
Tonis Tiigi f8b0573edb dockerfile: expose add-hosts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-08-03 13:56:14 -07:00
Tonis Tiigi 04a5cc81e8 dockerfile: add platform prefixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-31 10:41:36 -07:00
Tonis Tiigi d0aafaefd0 dockerfile: add stage prefixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-31 10:41:36 -07:00
Tonis Tiigi 4c44d2c6e4 dockerfile: custom names to vertexes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-31 10:41:30 -07:00
Tonis Tiigi 97fa2b527a cache: add all option to prune
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-26 22:55:05 -07:00
Tonis Tiigi 489246dd28 cache: support for internal/frontend record type
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-26 22:54:53 -07:00
Tonis Tiigi b966096ab5 dockerfile: allow setting image resolve mode
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 18:23:59 -07:00
Tonis Tiigi 9f5e5c7dc7 metaresolver: refactor to option struct and resolvemode
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 18:22:15 -07:00
Tonis Tiigi f719aadcba dockerfile: add tests for multi-platform exports
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 16:01:12 -07:00
Tonis Tiigi 6be1257f5d export: manifest list support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 16:01:12 -07:00
Tonis Tiigi 8c065401f2 exporter: reuse exptypes constants
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 16:01:12 -07:00
Tonis Tiigi 69bb8e8a15 dockerfile: allow automatic platform variables
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 16:01:05 -07:00
Tonis Tiigi 33f4382b69 dockerfile: support exporting multiple platforms
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-25 14:37:01 -07:00
Tonis Tiigi 0d6b052c97 dockerfile: add test for incremental copy regression
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-24 23:28:55 -07:00
Yuichiro Kaneko 08a5847eff Split resolving platform codes to `buildPlatformOpt`
This will make it easy to test these functions.

Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-24 08:46:32 +09:00
Yuichiro Kaneko 85987b10ee Rename `toEnvList` to `toEnvMap`
Because `toEnvList` was changed to return map.

Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-21 08:30:47 +09:00
Yuichiro Kaneko 80e2176450 Omit needless argument `override`
It always called with `override = true`.

Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-20 19:46:50 +09:00
Yuichiro Kaneko 936aa64061 Use `ProcessWord(s)WithMap` to avoid string contatination and string split
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-20 19:41:15 +09:00
Yuichiro Kaneko 5b70c51b7d Add test cases for `toEnvList`
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-20 19:31:43 +09:00
Yuichiro Kaneko 75118c8a82 Add Map version `ProcessWords`
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-20 19:01:31 +09:00
Tibor Vass 71e3c24df1
Merge pull request #517 from tonistiigi/llb-caps
llb: add caps support
2018-07-19 17:21:50 -07:00
Yuichiro Kaneko 83dc829222 Extract parsing logic of "key=val" as `parseKeyValue`
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-19 21:36:07 +09:00