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

Add Dockerfile #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SHIVANIUM-GIT
Copy link

  • Optimized Dockerfile: This pull request refines the Dockerfile used to build the linktoqr application. It focuses on reducing the image size by leveraging multi-stage builds and improving build efficiency.

  • Multi-Stage Build: The Dockerfile now has a cleaner separation between the build and runtime environments. Only the compiled binary (linktoqr) is copied to the final image, eliminating unnecessary build dependencies and source code.

  • Base Image Change: The base image has been switched from alpine:latest to alpine:3.15, a more minimal version that reduces the final image size further.

  • Efficient Dependency Management: Only the go.mod and go.sum files are copied initially to optimize the Go module dependency download process, followed by the application source code.

  • GOOS Conflict Resolution: The Dockerfile now resolves the GOOS conflict that caused the "Exec Format Error." By explicitly setting the GOARCH to amd64 in the build stage, we ensure the compiled binary matches the architecture of the target machine, preventing the execution issue. This modification addresses the architecture mismatch that was previously causing errors.

  • Issue ID: This change addresses the issue of large Docker image sizes, inefficiencies in the build process, and the GOOS conflict causing the "Exec Format Error" (related to issue GOOS Conflict in Dockerfile Causes Exec Format Error #18).

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.

1 participant