Update c/image and c/common to latest, c/buildah to main

... to include https://github.com/containers/image/pull/2173,
https://github.com/containers/common/pull/1731
and https://github.com/containers/buildah/pull/5143 .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-11-07 20:25:12 +01:00
parent 71aac2f430
commit ced07a55f4
65 changed files with 1138 additions and 505 deletions

View File

@ -29,8 +29,9 @@ type Copy struct {
Download bool
// If set, the owner:group for the destination. This value is passed
// to the executor for handling.
Chown string
Chmod string
Chown string
Chmod string
Checksum string
}
// Run defines a run operation required in the container.
@ -78,7 +79,7 @@ func (logExecutor) EnsureContainerPathAs(path, user string, mode *os.FileMode) e
func (logExecutor) Copy(excludes []string, copies ...Copy) error {
for _, c := range copies {
log.Printf("COPY %v -> %s (from:%s download:%t), chown: %s, chmod %s", c.Src, c.Dest, c.From, c.Download, c.Chown, c.Chmod)
log.Printf("COPY %v -> %s (from:%s download:%t), chown: %s, chmod %s, checksum: %s", c.Src, c.Dest, c.From, c.Download, c.Chown, c.Chmod, c.Checksum)
}
return nil
}

View File

@ -137,6 +137,7 @@ func add(b *Builder, args []string, attributes map[string]bool, flagArgs []strin
}
var chown string
var chmod string
var checksum string
last := len(args) - 1
dest := makeAbsolute(args[last], b.RunConfig.WorkingDir)
filteredUserArgs := make(map[string]string)
@ -160,11 +161,19 @@ func add(b *Builder, args []string, attributes map[string]bool, flagArgs []strin
if err != nil {
return err
}
case strings.HasPrefix(arg, "--checksum="):
checksum = strings.TrimPrefix(arg, "--checksum=")
default:
return fmt.Errorf("ADD only supports the --chmod=<permissions> and the --chown=<uid:gid> flag")
return fmt.Errorf("ADD only supports the --chmod=<permissions>, --chown=<uid:gid>, and --checksum=<checksum> flags")
}
}
b.PendingCopies = append(b.PendingCopies, Copy{Src: args[0:last], Dest: dest, Download: true, Chown: chown, Chmod: chmod})
b.PendingCopies = append(b.PendingCopies, Copy{
Src: args[0:last],
Dest: dest,
Download: true,
Chown: chown,
Chmod: chmod,
Checksum: checksum})
return nil
}

View File

@ -261,6 +261,10 @@ func Parse(rwc io.Reader) (*Result, error) {
currentLine := 0
root := &Node{StartLine: -1}
scanner := bufio.NewScanner(rwc)
buf := []byte{}
// containerfile may contain large lines,
// allocate 2MB for such use-cases.
scanner.Buffer(buf, 2048*1024)
warnings := []string{}
var err error
@ -312,6 +316,10 @@ func Parse(rwc io.Reader) (*Result, error) {
root.AddChild(child, startLine, currentLine)
}
if scannerErr := scanner.Err(); scannerErr != nil {
return nil, scannerErr
}
if len(warnings) > 0 {
warnings = append(warnings, "[WARNING]: Empty continuation lines will become errors in a future release.")
}

View File

@ -12,7 +12,7 @@
#
%global golang_version 1.8.1
%{!?version: %global version 1.2.5}
%{!?version: %global version 1.2.6-dev}
%{!?release: %global release 1}
%global package_name imagebuilder
%global product_name Container Image Builder