Skip to content

check in go.mod/go.sum, add Dockerfile#20

Draft
derhuerst wants to merge 3 commits intopatrickbr:masterfrom
derhuerst:docker-img
Draft

check in go.mod/go.sum, add Dockerfile#20
derhuerst wants to merge 3 commits intopatrickbr:masterfrom
derhuerst:docker-img

Conversation

@derhuerst
Copy link
Copy Markdown
Contributor

Even though the binaries work great as a low-effort way to run gtfstidy on some GTFS feeds, in some environments (e.g. CIs) using Docker is more straightforward.

still missing:

  • add metadata to the Docker image
  • let the CI build & publish the Docker image?

This is a follow-up PR on #8, which I have accidentally closed.

@derhuerst
Copy link
Copy Markdown
Contributor Author

The Docker build currently fails with these errors:

#11 [builder 7/7] RUN CGO_ENABLED=0 go build -o /usr/local/bin/gtfstidy
#11 58.64 # github.com/patrickbr/gtfstidy/processors
#11 58.64 processors/completegeotripsfilter.go:16:24: undefined: gtfsparser.Polygon
#11 58.64 processors/completegeotripsfilter.go:41:28: invalid operation: cannot call non-function st.Stop (variable of type *gtfs.Stop)
#11 58.64 processors/completegeotripsfilter.go:48:9: feed.DeleteTrip undefined (type *gtfsparser.Feed has no field or method DeleteTrip)
#11 58.64 processors/completegeotripsfilter.go:51:15: invalid operation: cannot call non-function st.Stop (variable of type *gtfs.Stop)
#11 58.64 processors/completegeotripsfilter.go:52:8: invalid operation: cannot call non-function st.Stop (variable of type *gtfs.Stop)
#11 58.64 processors/completegeotripsfilter.go:53:16: invalid operation: cannot call non-function st.Stop (variable of type *gtfs.Stop)
#11 58.64 processors/completegeotripsfilter.go:79:9: feed.DeletePathway undefined (type *gtfsparser.Feed has no field or method DeletePathway)
#11 58.64 processors/stopduplicateremover.go:162:34: undefined: gtfs.TransferKey
#11 58.64 processors/agencyduplicateremover.go:126:8: feed.DeleteAgency undefined (type *gtfsparser.Feed has no field or method DeleteAgency)
#11 58.64 processors/agencyduplicateremover.go:170:25: feed.AgenciesAddFlds undefined (type *gtfsparser.Feed has no field or method AgenciesAddFlds)
#11 58.64 processors/completegeotripsfilter.go:79:9: too many errors
#11 ERROR: process "/bin/sh -c CGO_ENABLED=0 go build -o /usr/local/bin/gtfstidy" did not complete successfully: exit code: 1

LABEL org.opencontainers.image.authors="Patrick Brosi <info@patrickbrosi.de>"
LABEL org.opencontainers.image.documentation="https://github.com/patrickbr/gtfstidy"
LABEL org.opencontainers.image.source="https://github.com/patrickbr/gtfstidy"
LABEL org.opencontainers.image.revision="v0.2"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revision must not be hard coded.

@@ -1 +1,3 @@
*.swp

/gtfstidy No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to .gitignore should be submitted separately.

LABEL org.opencontainers.image.revision="v0.2"
LABEL org.opencontainers.image.licenses="GPL-2.0"

COPY --from=builder /usr/local/bin/gtfstidy /usr/local/bin/gtfstidy
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about storing the binary at root? /gtfstidy

LABEL org.opencontainers.image.source="https://github.com/patrickbr/gtfstidy"
LABEL org.opencontainers.image.revision="v0.2"
LABEL org.opencontainers.image.licenses="GPL-2.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add USER to not run as root.

@@ -0,0 +1,9 @@
module github.com/patrickbr/gtfstidy
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove go.mod and go.sum from this PR.

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.

2 participants