Bug Report
Problem
The current Dockerfile uses golang:1.12 but the code requires go 1.20 (as specified in go.mod), causing build failures.
Error
cannot load embed: cannot find module providing package embed
ERROR: failed to solve: process "/bin/sh -c go mod download && go build -o etcdkeeper.bin main.go" did not complete successfully: exit code: 1
Environment
- Docker version: Any
- Platform: Any
Steps to Reproduce
- Clone the repository
- Run
docker build -t etcdkeeper .
- Build fails with Go version incompatibility
Root Cause
go.mod specifies go 1.20
Dockerfile uses FROM golang:1.12
- Go 1.12 doesn't support modern dependencies used in the project
Proposed Solution
Update Dockerfile to use a compatible Go version:
FROM golang:1.21 AS build # Updated from golang:1.12
Additional Improvements
- Update Alpine version to
3.18 for security
- Fix deprecated ENV format
- Use JSON format for CMD
Bug Report
Problem
The current Dockerfile uses
golang:1.12but the code requiresgo 1.20(as specified ingo.mod), causing build failures.Error
cannot load embed: cannot find module providing package embed
ERROR: failed to solve: process "/bin/sh -c go mod download && go build -o etcdkeeper.bin main.go" did not complete successfully: exit code: 1
Environment
Steps to Reproduce
docker build -t etcdkeeper .Root Cause
go.modspecifiesgo 1.20DockerfileusesFROM golang:1.12Proposed Solution
Update Dockerfile to use a compatible Go version:
FROM golang:1.21 AS build # Updated from golang:1.12Additional Improvements
3.18for security