Skip to content
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

update Dockerfile #348

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

hurricane1988
Copy link
Contributor

  1. add -ldflags '-s -w' in Dockerfile
    remove the main.go in build

@CLAassistant
Copy link

CLAassistant commented Aug 12, 2022

CLA assistant check
All committers have signed the CLA.

@benjaminhuo
Copy link
Member

@hurricane1988 Thanks for the contribution. Would you sign your commit like below?:

git commit -s --amend
git push -f

@wanjunlei @wrongerror @tpiperatgod , please help to review

@hurricane1988
Copy link
Contributor Author

@wrongerror could you review my request?

@wrongerror
Copy link
Member

Could you please describe the purpose of this PR? @hurricane1988

@benjaminhuo
Copy link
Member

@hurricane1988 Thanks for the contribution. Would you sign your commit like below?:

git commit -s --amend
git push -f

@wanjunlei @wrongerror @tpiperatgod , please help to review

@hurricane1988 You need to sign your commit first. And then you'll need to examine why the E2E test failed with your PR?

@hurricane1988
Copy link
Contributor Author

@hurricane1988 Thanks for the contribution. Would you sign your commit like below?:

git commit -s --amend
git push -f

@wanjunlei @wrongerror @tpiperatgod , please help to review

@hurricane1988 You need to sign your commit first. And then you'll need to examine why the E2E test failed with your PR?

OK, I will examine E2E test first.

@benjaminhuo
Copy link
Member

@hurricane1988 Your commits look a bit messed up. You may need to rebase or squash your commit:

git remote add upstream https://github.com/OpenFunction/OpenFunction.git
git fetch --all
git checkout main
git rebase upstream/main
git commit -s --amend
git push -f

# Build
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o openfunction main.go
# Build openfunction binary.
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags '-s -w' -installsuffix cgo -o openfunction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hurricane1988
Copy link
Contributor Author

Could you please describe the purpose of this PR? @hurricane1988
@wrongerror refer to https://go.dev/ref/mod, go mod tidy method "go mod tidy ensures that the go.mod file matches the source code in the module. It adds any missing module requirements necessary to build the current module’s packages and dependencies, and it removes requirements on modules that don’t provide any relevant packages", and go mod download method "The go mod download command downloads the named modules into the module cache.", I think we could speed up the building time with "go mod tidy" method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants