Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.git
/.gitignore
/.travis.yml

/processors/testfeed
/processors/testfeed-*
/**/*_test.go
/gtfstidy
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.swp

/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.

Changes to .gitignore should be submitted separately.

23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:alpine AS builder
WORKDIR /src

RUN apk add --no-cache --update git

COPY go.mod go.sum *.go ./
COPY processors/ ./processors/

RUN go get
RUN CGO_ENABLED=0 go build -o /usr/local/bin/gtfstidy

FROM scratch
LABEL org.opencontainers.image.title="gtfstidy"
LABEL org.opencontainers.image.description="A tool for checking, sanitizing and minimizing GTFS feeds."
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.

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.

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


ENTRYPOINT ["/usr/local/bin/gtfstidy"]
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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.


go 1.16

require (
github.com/patrickbr/gtfsparser v0.0.0-20210503211936-d06c485ba62b
github.com/patrickbr/gtfswriter v0.0.0-20210407163711-6625630376c8
github.com/spf13/pflag v1.0.5
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/patrickbr/gtfsparser v0.0.0-20210503211936-d06c485ba62b h1:C9TB1Jd8i2Q+Mii0VufGWRY/70n+9UUfslAd/Spz4yU=
github.com/patrickbr/gtfsparser v0.0.0-20210503211936-d06c485ba62b/go.mod h1:L88c76QEIfk3Z5pr1S715jfv1EIEVZ7BvNiefxz4o3o=
github.com/patrickbr/gtfswriter v0.0.0-20210407163711-6625630376c8 h1:rennEshiJjXDi7r9FTZjz1yUY0jFxWWGNVuNCdSsnVw=
github.com/patrickbr/gtfswriter v0.0.0-20210407163711-6625630376c8/go.mod h1:zYAfZRXtDhc4Tq+LYrvyksefggNiViL2pKMRUrGvUbE=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=