Comments (5)
I did some more research on this issue and it looks like your Dockerfile is problematic.
The way it's written is cool, but unfortunately go-licenses
seems to require a full go runtime.
This is my hacked up version of Dockerfile
FROM golang:1.16
WORKDIR /go-licenses
ARG GOFLAGS=""
ENV GOFLAGS=$GOFLAGS
ENV GO111MODULE=on
# Download dependencies first - this should be cacheable.
COPY go.mod go.sum ./
RUN go mod download
# Now add the local repo, which typically isn't cacheable.
COPY . .
# Check that all of the Go code builds
RUN go build ./...
# Run the tests
RUN go test -v ./...
# Install the binary into /go/bin
RUN go install .
# Save licenses, etc.
RUN go run . save . --save_path /THIRD_PARTY_NOTICES
Now I can run it like this:
docker run --entrypoint=/bin/bash -ti reslocal/go-licenses-container
In the container
go get -d github.com/influxdata/telegraf
go: downloading github.com/influxdata/telegraf v1.18.0
go get: upgraded github.com/google/go-cmp v0.3.1 => v0.5.4
go get: added github.com/influxdata/telegraf v1.18.0
go get: upgraded golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f => v0.0.0-20200820211705-5c72a883971a
go get: upgraded golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914 => v0.0.0-20201209123823-ac852fbbde11
go get: upgraded golang.org/x/sys v0.0.0-20191119060738-e882bf8e40c2 => v0.0.0-20201119102817-f84b799fce68
go get: upgraded golang.org/x/tools v0.0.0-20191118222007-07fc4c7f2b98 => v0.0.0-20201022035929-9cf592e881e9
cd /go/pkg/mod/github.com/influxdata/[email protected]/cmd/telegraf
go-licenses csv . > licenses.txt 2>&1
The result is this:
https://pastebin.com/JchrPZ99
... which does not seem to be very useful.
First Error: https://github.com/couchbase/goutils does have a LICENSE.md file
from go-licenses.
The current version of go-licenses uses a google/licenseclassifier version that embeds the data into the binary, so this issue will no longer show up.
from go-licenses.
I stumbled over this (or a similar related issue) after having upgraded various dependencies. I got the error "main.go:77] cannot register licenses from archive: open licenses.db: file does not exist", and had to downgrade the licenseclassfier library to get it working again (go: downgraded github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab => v0.0.0-20210722185704-3043a050f148
).
Worthy of note is that executing the tool with explicit version specified (go run github.com/google/[email protected] save --ignore=my-package --force --save_path licenses ./...
) worked fine, while doing go get -u github.com/google/[email protected]
then go run without version (go run github.com/google/go-licenses save --ignore=my-package --force --save_path licenses ./...
) exhibited the above issue.
from go-licenses.
I stumbled over this (or a similar related issue) after having upgraded various dependencies. I got the error "main.go:77] cannot register licenses from archive: open licenses.db: file does not exist", and had to downgrade the licenseclassfier library to get it working again (
go: downgraded github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab => v0.0.0-20210722185704-3043a050f148
).Worthy of note is that executing the tool with explicit version specified (
go run github.com/google/[email protected] save --ignore=my-package --force --save_path licenses ./...
) worked fine, while doinggo get -u github.com/google/[email protected]
then go run without version (go run github.com/google/go-licenses save --ignore=insight-api --force --save_path licenses ./...
) exhibited the above issue.
What's your go version? go get is now deprecated for installing binaries. Use go install instead. You might be accidentally using an old binary.
from go-licenses.
Go 1.20.7. But i never installed any binary using go get
in this instance, I upgraded my dependencies, and since we use the tools.go method to pin versions of our tooling, then run the tools using go run
. I upgraded the "licenseclassifier" and "copy" libraries to versions that does not work with go-licenses using go get -u
.
from go-licenses.
Related Issues (20)
- Export local license paths HOT 2
- Improper `isStdlib()` path check using `strings.HasPrefix()` HOT 2
- Wrong GOROOT is used when go-licenses builds and runs on different environments HOT 6
- Enable module version logging in custom reports
- go-licenses with go vendoring HOT 2
- go-licenses command is not recognized HOT 1
- How to check all licenses in a project? HOT 2
- `LICENSE` file in repo root is ignored HOT 4
- LICENSE detection is OS specific HOT 5
- go-licenses doesn't work when installed with versioned go HOT 3
- insufficient confidence threshold when identifying a BSD 2-Clause like license HOT 3
- Upgrade to google/licenseclassifier v2 HOT 2
- Prepare for v2 release HOT 5
- Help needed resolving `github.com/otiai10/copy` diamond dependency problem HOT 5
- Flags stdilb as "does not have module info" when on `go 1.21.X` HOT 6
- Ignore `W0104 contains non-Go code` warnings in errors
- Migrate to newer go-git HOT 1
- Reporting warnings for external packages on Windows
- no way to legally construct a source.Client
- How to display verbose logging?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-licenses.