Alpine base image and some dependencies upgraded
Details in the reweave CHANGELOG
This commit is contained in:
1 parent
1ceeca80e6
commit
0d58e17954
368 files changed
+23406
-9163
No files matched your search
+9
-10
@@ -7,14 +7,13 @@ package docker
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/fileutils"
|
||||
"github.com/moby/patternmatcher"
|
||||
)
|
||||
|
||||
func createTarStream(srcPath, dockerfilePath string) (io.ReadCloser, error) {
|
||||
@@ -45,9 +44,9 @@ func createTarStream(srcPath, dockerfilePath string) (io.ReadCloser, error) {
|
||||
if includeFile == "" {
|
||||
continue
|
||||
}
|
||||
keepThem, err := fileutils.Matches(includeFile, excludes)
|
||||
keepThem, err := patternmatcher.Matches(includeFile, excludes)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot match .dockerfile: '%s', error: %s", includeFile, err)
|
||||
return nil, fmt.Errorf("cannot match .dockerfileignore: '%s', error: %w", includeFile, err)
|
||||
}
|
||||
if keepThem {
|
||||
includes = append(includes, includeFile)
|
||||
@@ -74,7 +73,7 @@ func validateContextDirectory(srcPath string, excludes []string) error {
|
||||
// skip this directory/file if it's not in the path, it won't get added to the context
|
||||
if relFilePath, relErr := filepath.Rel(srcPath, filePath); relErr != nil {
|
||||
return relErr
|
||||
} else if skip, matchErr := fileutils.Matches(relFilePath, excludes); matchErr != nil {
|
||||
} else if skip, matchErr := patternmatcher.Matches(relFilePath, excludes); matchErr != nil {
|
||||
return matchErr
|
||||
} else if skip {
|
||||
if f.IsDir() {
|
||||
@@ -85,7 +84,7 @@ func validateContextDirectory(srcPath string, excludes []string) error {
|
||||
|
||||
if err != nil {
|
||||
if os.IsPermission(err) {
|
||||
return fmt.Errorf("can't stat '%s'", filePath)
|
||||
return fmt.Errorf("cannot stat %q: %w", filePath, err)
|
||||
}
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
@@ -101,8 +100,8 @@ func validateContextDirectory(srcPath string, excludes []string) error {
|
||||
|
||||
if !f.IsDir() {
|
||||
currentFile, err := os.Open(filePath)
|
||||
if err != nil && os.IsPermission(err) {
|
||||
return fmt.Errorf("no permission to read from '%s'", filePath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot open %q for reading: %w", filePath, err)
|
||||
}
|
||||
currentFile.Close()
|
||||
}
|
||||
@@ -112,9 +111,9 @@ func validateContextDirectory(srcPath string, excludes []string) error {
|
||||
|
||||
func parseDockerignore(root string) ([]string, error) {
|
||||
var excludes []string
|
||||
ignore, err := ioutil.ReadFile(path.Join(root, ".dockerignore"))
|
||||
ignore, err := os.ReadFile(path.Join(root, ".dockerignore"))
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return excludes, fmt.Errorf("error reading .dockerignore: '%s'", err)
|
||||
return excludes, fmt.Errorf("error reading .dockerignore: %w", err)
|
||||
}
|
||||
excludes = strings.Split(string(ignore), "\n")
|
||||
|
||||
|
||||
Reference in new issue
Block a user