docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/docker/roadmap/projects/1
Creative Commons Zero v1.0 Universal
1.45k stars 244 forks source link

docker init with golang and empty go.sum #611

Open s0rbus opened 3 months ago

s0rbus commented 3 months ago

I have been trying out the (relatively) new docker init command with a simple golang project. It is so simple (a web server), that it does not require any packages and so a go.sum file is not created. When I run docker compose up --build, I get an error because the generated Dockerfile tries to bind mount go.sum. It works if I manually create a go.sum (touch go.sum).

Would it be possible for the Dockerfile to check for go.sum not being available and so not try and mount it? Or create an empty go.sum file during docker init?

At the very least a warning to user before they attempt a compose build?

nunocoracao commented 3 months ago

Hello @s0rbus thanks for raising this. The team will look into it.