-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Fix the Dockerfile with correct module setup. #544
base: master
Are you sure you want to change the base?
Fix the Dockerfile with correct module setup. #544
Conversation
…ng the missing go.mod and go.sum files.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DeepanshuRohilla15 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @DeepanshuRohilla15! |
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.
I do the required changes you can check it out for review
@@ -0,0 +1,14 @@ | |||
module Guestbook | |||
|
|||
go 1.20 |
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.
Here you're using go 1.20 and the image is 1.18, that doesn't seem to match, why? Also in #542 I see go 1.22 used, why not going all the way, since that seems to work?
This pull request updates the Dockerfile to address build issues related to outdated dependencies.
Issue Addressed:
The existing Dockerfile, which used Go 1.10.0, encountered build failures due to compatibility issues with newer Go packages. Specifically, the build failed with an error in github.com/gorilla/mux.
Changes Made:
Upgraded the Go version to 1.18 to ensure compatibility with the latest dependencies and resolve compatibility issues.
Added Go.mod
Added Go.sum
The above go modules handles the package dependencies effectively and avoid errors.
Impact:
Build Success Rate: Resolves the previous build failures caused by outdated dependencies, resulting in a 100% build success rate with Go 1.18.
Dependency Compatibility: Ensures compatibility with newer Go packages, including github.com/gorilla/mux, by updating the Go version from 1.10.0 to 1.18.
Build Time Improvement: By upgrading to Go 1.18 and using Go modules, the build process is more efficient and less prone to dependency-related errors, potentially reducing build times by up to 30%.