Commit Graph

154 Commits (5ea3a003f75b5f22174c893ca4210bac303d1524)

Author SHA1 Message Date
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
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 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
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
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
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 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 15ef4e2b8a dockerfile: allow content cache for rw mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-02 19:40:30 -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 c6149da2eb fileop: review fixes
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 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
Tonis Tiigi 62697a93f7 dockerfile: allow custom context names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-02-23 09:12:54 -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 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
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 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 ec2ab81a3b dockerfile: update copy source repo
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-11-06 11:14:59 -08: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 945e100a8c dockerfile: disable network for copy
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-22 13:23:10 -07: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 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
Tonis Tiigi 48ec136f1b dockerfile: update default copy image
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-05 14:35:33 -07: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
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
Tonis Tiigi f6e104da5f gateway: allow access to apicaps
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-21 15:33:41 -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 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
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