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
Tõnis Tiigi
db8b382274
Merge pull request #518 from yui-knk/add_test_for_addEnv
...
Add test cases for `addEnv` which is a bit complicated function
2018-07-18 22:41:39 -07:00
Akihiro Suda
1be4a5891d
Merge pull request #516 from yui-knk/update_comment_Parse
...
Add a description about metaArgs return value
2018-07-19 12:16:37 +09:00
Yuichiro Kaneko
f79f28cf83
Add test cases for `addEnv` which is a bit complicated function
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-19 09:39:22 +09:00
Tonis Tiigi
c8cb8127c3
gateway: validate LLB capabilities
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-18 17:22:30 -07:00
Tonis Tiigi
d4c57aec5d
llb: add caps support
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-18 17:22:30 -07:00
Yuichiro Kaneko
93e3b15854
`s/docker file/Dockerfile/`
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-19 07:38:58 +09:00
Yuichiro Kaneko
ee15340993
Add a description about metaArgs return value
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-18 22:32:15 +09:00
Yuichiro Kaneko
fb499edc5b
Omit needless argument `commit` from `dispatchEnv`
...
Always `dispatchEnv` is called `commit` with `true`.
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-18 21:38:37 +09:00
Yuichiro Kaneko
5838f9e763
Simplify `State` setup
...
On this code `dispatchEnv` is called with `commit = false`,
so this call do these 2 things
* `AddEnv` to `d.state`
* `addEnv` to update `d.image.Config.Env`
But updating `d.image.Config.Env` has no effect on `d.image.Config.Env`
because this is in for-loop of `range d.image.Config.Env`.
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-18 21:29:55 +09:00
Yuichiro Kaneko
c9038a2f5d
Use `ProcessWordWithMap` in simple cases
...
In the case when the second argument of `toEnvList` is `nil`,
we can use `ProcessWordWithMap` and avoid string contatination
and string split.
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-18 08:54:18 +09:00
Yuichiro Kaneko
8715fbf6bf
Add string map version ProcessWord to Lex
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-16 17:49:28 +09:00
Yuichiro Kaneko
6583105db9
Use strings map instead of slice of string in `shellWord`
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-16 17:46:28 +09:00
Tonis Tiigi
303b5da713
llbsolver: use result type with multi ref support
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 17:52:23 -07:00
Tonis Tiigi
c3a29cce8b
gateway: implementation for return
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 17:51:44 -07:00
Tonis Tiigi
95d944cc31
gateway: use return in grpcclient
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 17:51:44 -07:00
Tonis Tiigi
01b7a29e86
gateway: return result from solve
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 17:51:44 -07:00
Tonis Tiigi
9684362cb0
frontend: move forwarder under gateway
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 17:50:19 -07:00
Tonis Tiigi
d9f1a1d99f
gateway: expose buildopts and result
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 17:50:19 -07:00
Tonis Tiigi
30601fb7e5
gateway: fix product env passing
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-12 16:04:58 -07:00
Tonis Tiigi
bdf391a67d
dockerfile: test for snapshot leak
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-11 16:21:32 -07:00
Tonis Tiigi
ddf3f3e59c
frontend: fix two data races
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-10 19:31:33 -07:00
Tõnis Tiigi
f4694ee01b
Merge pull request #488 from yui-knk/stop_create_ArgCommand
...
Use simple `keyValuePair` to `dispatchOpt.metaArgs` and `dispatchState.buildArgs`
2018-07-10 08:02:21 -07:00
Yuichiro Kaneko
c641b43e4a
Use simple `KeyValuePairOptional` to `dispatchOpt.metaArgs` and `dispatchState.buildArgs`
...
`KeyValuePairOptional` is enough in this case. We can avoid create `ArgCommand` out of Parser
by replacing them with `KeyValuePairOptional`.
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-10 19:24:43 +09:00
Tonis Tiigi
d5c9d39128
apicaps: set exportedproduct from binary
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:39 -07:00
Tonis Tiigi
c8fa75ffc1
dockerfile: read default build platform from workers
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:39 -07:00
Tonis Tiigi
946a12eb42
gateway: expose worker information
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:39 -07:00
Tonis Tiigi
90d164ced5
gateway: inital caps detection support
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:38 -07:00
Tonis Tiigi
ae1127be14
frontend: define default caps
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:38 -07:00
Tonis Tiigi
db5b0f1b9a
api: add caps support for versioning
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:32:34 -07:00
Tõnis Tiigi
cda0a64eca
Merge pull request #486 from AkihiroSuda/update-rootless
...
rootless: refactor libcontainer_specconv & add integration tests
2018-07-05 11:26:26 -07:00
Tõnis Tiigi
c111113a2f
Merge pull request #278 from AkihiroSuda/cache-transferable
...
decouple remotecache from Docker registry
2018-07-05 11:18:50 -07:00
Yuichiro Kaneko
b5c66082a1
Fix orders of `require.Equal` argument to "expected, actual"
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-04 21:59:37 +09:00
Akihiro Suda
580dbe08b9
rootless: add integration tests
...
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-07-04 19:27:54 +09:00
Akihiro Suda
80d2f820f9
decopule cache/remotecache from registry
...
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-07-04 17:38:09 +09:00
Yuichiro Kaneko
30c27cd6bf
Return an error when copying from url
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 20:28:08 +09:00
Yuichiro Kaneko
ec798d6b09
Update documents of `AddCommand`
...
`ADD` does not support git.
Ref: https://github.com/moby/moby/issues/14704#issuecomment-298134333
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 09:25:30 +09:00
Yuichiro Kaneko
b8bf5d0da9
Refactoring `toCommand` and `detectRunMount` to only depend to `dispatchStates`
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 07:38:34 +09:00
Yuichiro Kaneko
0d5c12363a
Introduce `dispatchStates` type
...
`dispatchStates` manages a collection of `dispatchState`.
By `dispatchStates`, we can aggregate how to find `dispatchState`
in one place and `dispatchStatesByName` local variable in `Dockerfile2LLB`
can be removed.
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-03 07:36:07 +09:00
Yuichiro Kaneko
fdfa7b8431
Add description about Unix
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-07-01 00:08:35 +09:00
Yuichiro Kaneko
a448c8f3fb
Fix a typo
...
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-06-30 11:20:33 +09:00
Anda Xu
7f64188f17
add missing supplementary group IDs
...
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-06-29 18:50:03 -07:00
Tõnis Tiigi
3b9737dd5a
Merge pull request #470 from yui-knk/ensure_arg_is_not_blank
...
Ensure BaseName of Stage is not blank
2018-06-28 10:32:11 -07:00
Yuichiro Kaneko
813575f62a
Ensure BaseName of Stage is not blank
...
Related: https://github.com/moby/moby/issues/37325
Signed-off-by: Yuichiro Kaneko <spiketeika@gmail.com>
2018-06-28 20:21:41 +09:00
Akihiro Suda
cce2080ddb
Merge pull request #468 from tonistiigi/update-containerd
...
vendor: update containerd to 08f7ee982
2018-06-27 14:37:47 +09:00
Tonis Tiigi
97abda7528
dockerfile: use manifest list copy image
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-26 21:22:32 -07:00
Tonis Tiigi
5dea4ade69
dockerfile: allow setting target platform with opts
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-26 21:14:52 -07:00
Tonis Tiigi
65e6d4d21a
dockerfile: allow autodetect platform from image config
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-26 10:42:30 -07:00
Tonis Tiigi
e618878451
dockerfile: platform support
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-25 11:06:08 -07:00
Tonis Tiigi
f9383c48a3
source: image source platform support
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-25 10:39:17 -07:00
Tonis Tiigi
dc9de85069
llb: force platform in llb and allow constraints
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-22 16:49:03 -07:00
Akihiro Suda
b36d2dc272
Merge pull request #459 from tonistiigi/optional-digest
...
gateway: allow digest to be optional
2018-06-21 08:42:42 +09:00
Tonis Tiigi
bdb77f073a
gateway: protect gateway forwarder map access
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-20 11:17:05 -07:00
Tonis Tiigi
e5449521f5
gateway: allow digest to be optional
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-20 11:09:32 -07:00
Akihiro Suda
cfe4e19158
Merge pull request #455 from tonistiigi/cache-sharing
...
llbsolver: allow sharing modes for cache mounts
2018-06-21 00:17:05 +09:00
Tonis Tiigi
cdcab49bfc
dockerfile: expose cache sharing options
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-19 15:57:25 -07:00
Tonis Tiigi
ccbf185006
llbsolver: allow sharing modes for cache mounts
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-19 15:57:20 -07:00
Tonis Tiigi
941407f6c0
dockerfile: escape git regexp
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-18 11:26:07 -07:00
Akihiro Suda
00140b7992
Merge pull request #440 from ijc/configurable-client-timeout
...
client: take a context.Context to New().
2018-06-15 16:08:33 -07:00
Vincent Demeester
79241f25d5
Update tests to use gotest.tools 👼
...
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-11 15:52:17 +02:00
Ian Campbell
97ffd6cce8
client: take a context.Context to New().
...
This allows two things:
- The caller to set a shorter timeout than previously hardcoded 30s. In
`buildctl` reduce the timeout to 5s. Since the existing timeout has gone
callers will need to arrange to pass one themselves.
- The caller can arrange for the context to be cancelled for other reasons, use
this in `buildctl` to plumb through the Ctrl-C handling, meaning that
`buildctl` now exits almost immediately on Ctrl-C instead of after several
seconds.
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-11 14:28:08 +01:00
Tõnis Tiigi
704a40048b
Merge pull request #448 from tiborvass/update-copy-image
...
dockerfile: update copy image to v0.1.3
2018-06-08 20:06:17 -07:00
Tibor Vass
eb44845441
dockerfile: update copy image to v0.1.3
...
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-09 02:49:34 +00:00