Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfile: graduate ADD <git ref> and ADD --checksum=<checksum> from labs #3979

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ run:

build-tags:
- dfrunsecurity
- dfaddgit
- dfaddchecksum

linters:
enable:
Expand Down
6 changes: 0 additions & 6 deletions frontend/dockerfile/dockerfile2llb/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,6 @@ func dispatchCopy(d *dispatchState, cfg copyConfig) error {
if !cfg.isAddCommand {
return errors.New("checksum can't be specified for COPY")
}
if !addChecksumEnabled {
return errors.New("instruction 'ADD --checksum=<CHECKSUM>' requires the labs channel")
}
if len(cfg.params.SourcePaths) != 1 {
return errors.New("checksum can't be specified for multiple sources")
}
Expand All @@ -1082,9 +1079,6 @@ func dispatchCopy(d *dispatchState, cfg copyConfig) error {
if !cfg.isAddCommand {
return errors.New("source can't be a git ref for COPY")
}
if !addGitEnabled {
return errors.New("instruction ADD <git ref> requires the labs channel")
}
// TODO: print a warning (not an error) if gitRef.UnencryptedTCP is true
commit := gitRef.Commit
if gitRef.SubDir != "" {
Expand Down
6 changes: 0 additions & 6 deletions frontend/dockerfile/dockerfile2llb/convert_addchecksum.go

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/dockerfile/dockerfile2llb/convert_addgit.go

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/dockerfile/dockerfile2llb/convert_noaddchecksum.go

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/dockerfile/dockerfile2llb/convert_noaddgit.go

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/dockerfile/dockerfile_addchecksum_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build dfaddchecksum
// +build dfaddchecksum

package dockerfile

import (
Expand Down
3 changes: 0 additions & 3 deletions frontend/dockerfile/dockerfile_addgit_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build dfaddgit
// +build dfaddgit

package dockerfile

import (
Expand Down
2 changes: 2 additions & 0 deletions frontend/dockerfile/docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ guide – Leverage build cache](https://docs.docker.com/develop/develop-images/d
> **Note**
>
> Not yet available in stable syntax, use [`docker/dockerfile:1-labs`](#syntax) version (`1.5-labs` or newer).
> Planned to be included in `docker/dockerfile:1.6`.

The checksum of a remote file can be verified with the `--checksum` flag:

Expand All @@ -1312,6 +1313,7 @@ The `--checksum` flag only supports HTTP sources currently.
> **Note**
>
> Not yet available in stable syntax, use [`docker/dockerfile:1-labs`](#syntax) version (`1.5-labs` or newer).
> Planned to be included in `docker/dockerfile:1.6`.

This form allows adding a git repository to an image directly, without using the `git` command inside the image:
```
Expand Down
2 changes: 1 addition & 1 deletion frontend/dockerfile/release/labs/tags
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dfrunsecurity dfaddgit dfaddchecksum
dfrunsecurity