-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This option can to be set to debug digest mismatch issue. It generates a trace a build time and a trace at runtime. These trace contains all file attribute written to the tar stream and the chechsum of all file writter to the tar stream. This could allow to identify differences because of the sandbox used at build time while the Nix build sandbox is not used to run time, when the image is pushed to a destination.
- Loading branch information
Showing
8 changed files
with
263 additions
and
61 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
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,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/nlewo/nix2container/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var traceCmd = &cobra.Command{ | ||
Use: "trace IMAGE.JSON", | ||
Short: "Generate a trace based on the image.json", | ||
Args: cobra.MinimumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
image, err := nix.NewImageFromFile(args[0]) | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "%s", err) | ||
os.Exit(1) | ||
} | ||
|
||
for _, l := range image.Layers { | ||
nix.TarPathsTrace(l.Paths, os.Stdout) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(traceCmd) | ||
} |
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
Oops, something went wrong.