-
Notifications
You must be signed in to change notification settings - Fork 611
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 from stdin #440
Conversation
cmd/nerdctl/build.go
Outdated
if err != nil { | ||
return err | ||
} | ||
|
||
defer os.RemoveAll(tempDockerfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: only if tempDockerfile != ""
cmd/nerdctl/build.go
Outdated
dir, file = filepath.Split(filename) | ||
} | ||
|
||
if dockerfileReader != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can merge this if dockerfileReader != nil
to if filename == "-"
cmd/nerdctl/build.go
Outdated
return "", nil, false, "", err | ||
} | ||
file = buildkitutil.DefaultDockerfileName | ||
tempDockerfile = dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tempDockerfile
looks misnomer. Probably called like tempDockerfileDir
cmd/nerdctl/build_test.go
Outdated
CMD ["echo", "nerdctl-build-test-stdin"] | ||
`, testutil.AlpineImage) | ||
|
||
base.Cmd("build", "-t", imageName, "-f", "-", ".").CmdOption(testutil.WithStdin(strings.NewReader(dockerfile))).AssertOK() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AssertOut("nerdctl-build-test-stdin")
cmd/nerdctl/build.go
Outdated
@@ -118,50 +121,51 @@ func buildAction(cmd *cobra.Command, args []string) error { | |||
return nil | |||
} | |||
|
|||
func generateBuildctlArgs(cmd *cobra.Command, args []string) (string, []string, bool, error) { | |||
func generateBuildctlArgs(cmd *cobra.Command, args []string) (string, []string, bool, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably return cleanup func() error
rather than string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Please squash commits |
e00d10f
to
6c483da
Compare
@AkihiroSuda done |
d773d34
to
8ac9454
Compare
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
8ac9454
to
bd178f7
Compare
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
LGTM, thanks. Added a commit to use a permalink in |
fixing #387
Signed-off-by: fahed dorgaa fahed.dorgaa@gmail.com