Skip to content

Commit 627e5cf

Browse files
committed
forgot
1 parent 302c961 commit 627e5cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/docker/image.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ func parseDockerImageListOutput(output []byte) []string {
4242

4343
// BuildDockerImage builds a docker image on a remote host.
4444
func BuildDockerImage(host *models.Host, image string, path string, dockerfile string) error {
45-
goVersion, err := utils.ReadGoVersion(filepath.Join(path, "go.mod"))
45+
// expectation is to have go.mod next to Dockerfile
46+
goVersion, err := utils.ReadGoVersion(filepath.Join(filepath.Dir(dockerfile), "go.mod"))
4647
if err != nil {
4748
//fall back to default
49+
//return err
4850
goVersion = constants.BuildEnvGolangVersion
4951
}
5052
_, err = host.Command(fmt.Sprintf("cd %s && docker build -q --build-arg GO_VERSION=%s -t %s -f %s .", path, goVersion, image, dockerfile), nil, constants.SSHLongRunningScriptTimeout)

0 commit comments

Comments
 (0)