-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e.g., ```dockerfile FROM alpine ADD https://github.com/moby/buildkit.git#v0.10.1 /buildkit ``` Close issue 775 Signed-off-by: Akihiro Suda <[email protected]>
- Loading branch information
1 parent
b1720cf
commit 2bef49a
Showing
8 changed files
with
348 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,44 @@ incrementing the major component of a version and you may want to pin the image | |
change in between releases on labs channel, the old versions are guaranteed to be backward compatible. | ||
|
||
|
||
## Adding a git repository `ADD <git ref> <dir>` | ||
|
||
<!-- TODO: dockerfile-upstream:master -> dockerfile:1.5 after the release of 1.5 --> | ||
To use this instruction, set the frontend to `docker/dockerfile-upstream:master`: | ||
|
||
```dockerfile | ||
# syntax=docker/dockerfile-upstream:master` | ||
``` | ||
|
||
This instruction allows you to add a git repository to an image directly, without using the `git` command inside the image. | ||
|
||
```dockerfile | ||
# syntax=docker/dockerfile-upstream:master | ||
FROM alpine | ||
ADD --keep-git-dir=true https://github.com/moby/buildkit.git#v0.10.1 /buildkit | ||
``` | ||
|
||
The `--keep-git-dir=true` flag adds the `.git` directory. This flag defaults to false. | ||
|
||
|
||
### Adding a private git repository | ||
To add a private repo via SSH, create a Dockerfile with the following syntax: | ||
```dockerfile | ||
# syntax = docker/dockerfile-upstream:master | ||
FROM alpine | ||
ADD [email protected]:foo/bar.git /bar | ||
``` | ||
|
||
This Dockerfile can be built with `docker build --ssh` or `buildctl build --ssh`, e.g., | ||
|
||
```console | ||
$ docker build --ssh default | ||
``` | ||
|
||
```console | ||
$ buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --ssh default | ||
``` | ||
|
||
## Linked copies `COPY --link`, `ADD --link` | ||
|
||
To use this flag set Dockerfile version to at least `1.4`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.