Skip to content

Commit

Permalink
Merge pull request #4742 from crazy-max/v0.13_cherry-picks
Browse files Browse the repository at this point in the history
[v0.13] cherry-picks
  • Loading branch information
tonistiigi authored Mar 7, 2024
2 parents 2afc050 + f64b48e commit 3f62976
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ jobs:
runs-on: ubuntu-22.04
needs:
- prepare
env:
GOLANGCI_LINT_MULTIPLATFORM: 1
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
-
name: Prepare
run: |
if [ "$GITHUB_REPOSITORY" = "moby/buildkit" ]; then
echo "GOLANGCI_LINT_MULTIPLATFORM=1" >> $GITHUB_ENV
fi
-
name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ Keys supported by image output:
* `name-canonical=true`: add additional canonical name `name@<digest>`
* `compression=<uncompressed|gzip|estargz|zstd>`: choose compression type for layers newly created and cached, gzip is default value. estargz should be used with `oci-mediatypes=true`.
* `compression-level=<value>`: compression level for gzip, estargz (0-9) and zstd (0-22)
* `rewrite-timestamp=true` (Present in the `master` branch <!-- TODO: v0.13-->): rewrite the file timestamps to the `SOURCE_DATE_EPOCH` value.
* `rewrite-timestamp=true`: rewrite the file timestamps to the `SOURCE_DATE_EPOCH` value.
See [`docs/build-repro.md`](docs/build-repro.md) for how to specify the `SOURCE_DATE_EPOCH` value.
* `force-compression=true`: forcefully apply `compression` option to all layers (including already existing layers)
* `store=true`: store the result images to the worker's (e.g. containerd) image store as well as ensures that the image has all blobs in the content store (default `true`). Ignored if the worker doesn't have image store (e.g. OCI worker).
Expand Down
9 changes: 2 additions & 7 deletions docs/build-repro.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ Minimal support is also available on older BuildKit when using Dockerfile 1.5 fr
```console
buildctl build --frontend dockerfile.v0 --opt build-arg:SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ...
```

The `buildctl` CLI (<= 0.12) does not automatically propagate the `$SOURCE_DATE_EPOCH` environment value from the client host to the `SOURCE_DATE_EPOCH` build arg.
<!-- TODO: s/master/v0.13/ -->
In the `master` branch of BuildKit, the `buildctl` CLI is updated to automatically capture the environment value.
Docker Buildx (>= 0.10) automatically captures the environment value too.
The `buildctl` CLI (>= v0.13) and Docker Buildx (>= 0.10) automatically propagate the `$SOURCE_DATE_EPOCH` environment value from the client host to the `SOURCE_DATE_EPOCH` build arg.

The build arg value is used for:
- the `created` timestamp in the [OCI Image Config](https://github.com/opencontainers/image-spec/blob/main/config.md#properties)
Expand All @@ -64,8 +60,7 @@ To apply the build arg value to the timestamps of the files inside the image, sp
--output type=image,name=docker.io/username/image,push=true,rewrite-timestamp=true
```

<!-- TODO: s/master/v0.13/ -->
The `rewrite-timestamp` option is only available in the `master` branch of BuildKit.
The `rewrite-timestamp` option is available since BuildKit v0.13.
See [v0.12 documentation](https://github.com/moby/buildkit/blob/v0.12/docs/build-repro.md#caveats) for dealing with timestamps
in BuildKit v0.12 and v0.11.

Expand Down
8 changes: 8 additions & 0 deletions docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ We will apprecate any feedback by [opening an issue here](https://github.com/mob

> **NOTE:** all these requires running as admin (elevated) on a PowerShell terminal.
Make sure that `Containers` feature is enabled. (_`Microsoft-Hyper-V` is a bonus but not necessarily needed for our current guide. Also it's depended on your virtualization platform setup._) Run:

```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V, Containers -All
```

You will be asked to restart your machine, do so, and then continue with the rest of the steps. No other restart needed.

1. Setup `containerd` by following [the setup instructions here](https://github.com/containerd/containerd/blob/main/docs/getting-started.md#installing-containerd-on-windows). (_Currently, we only support the `containerd` worker_.)
1. Start the `containerd` service, if not yet started.
1. Download and extract:
Expand Down
10 changes: 4 additions & 6 deletions frontend/dockerfile/docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,7 @@ conditions for cache reuse.

> **Note**
>
> Available in [`docker/dockerfile-upstream:master-labs`](#syntax).
> Will be included in `docker/dockerfile:1.7-labs`.
> Not yet available in stable syntax, use [`docker/dockerfile:1.7-labs`](#syntax) version.
```dockerfile
COPY [--parents[=<boolean>]] <src> ... <dest>
Expand All @@ -1585,7 +1584,7 @@ COPY [--parents[=<boolean>]] <src> ... <dest>
The `--parents` flag preserves parent directories for `src` entries. This flag defaults to `false`.

```dockerfile
# syntax=docker/dockerfile-upstream:master-labs
# syntax=docker/dockerfile:1.7-labs
FROM scratch

COPY ./x/a.txt ./y/a.txt /no_parents/
Expand All @@ -1605,7 +1604,7 @@ directories after it will be preserved. This may be especially useful copies bet
with `--from` where the source paths need to be absolute.

```dockerfile
# syntax=docker/dockerfile-upstream:master-labs
# syntax=docker/dockerfile:1.7-labs
FROM scratch

COPY --parents ./x/./y/*.txt /parents/
Expand Down Expand Up @@ -1634,8 +1633,7 @@ with the `--parents` flag, the Buildkit is capable of packing multiple

> **Note**
>
> Available in [`docker/dockerfile-upstream:master-labs`](#syntax).
> Will be included in `docker/dockerfile:1.7-labs`.
> Not yet available in stable syntax, use [`docker/dockerfile:1.7-labs`](#syntax) version.
```dockerfile
COPY [--exclude=<path> ...] <src> ... <dest>
Expand Down

0 comments on commit 3f62976

Please sign in to comment.