-
-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(builder): use docker-buildx plugin to build for non-native platf…
…orms
- Loading branch information
Showing
1,115 changed files
with
102,365 additions
and
66,496 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package builder | ||
|
||
import ( | ||
"context" | ||
"path/filepath" | ||
|
||
"github.com/docker-slim/docker-slim/pkg/util/fsutil" | ||
) | ||
|
||
// ImageBuilder builds an image and returns some data from the build. | ||
type ImageBuilder interface { | ||
// Build the image. | ||
Build(context.Context) error | ||
// GetLogs from the image builder. | ||
GetLogs() string | ||
// HasData file/dir that got ADD'd or COPY'd into the image, respectively. | ||
HasData() bool | ||
} | ||
|
||
const ( | ||
tarData = "files.tar" | ||
dirData = "files" | ||
) | ||
|
||
// getDataName returns a predetermined name if it exists within the root dir. | ||
func getDataName(root string) string { | ||
|
||
dataTar := filepath.Join(root, tarData) | ||
dataDir := filepath.Join(root, dirData) | ||
if fsutil.IsRegularFile(dataTar) { | ||
return tarData | ||
} else if fsutil.IsDir(dataDir) { | ||
return dirData | ||
} | ||
|
||
return "" | ||
} |
Oops, something went wrong.