Skip to content

docker init with golang and empty go.sum #611

@s0rbus

Description

@s0rbus

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?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Shipped! Enjoy!

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions