Skip to content

Commit

Permalink
removed VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Cascio committed Jul 13, 2021
1 parent def9814 commit b66cdda
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FROM golang:1.16.2 AS builder
WORKDIR /go/src/github.com/gliderlabs/registrator/
COPY . .
RUN \
CGO_ENABLED=0 GOOS=linux go build \
-a -installsuffix cgo \
-ldflags "-X main.Version=$(cat VERSION)" \
-o bin/registrator \
.
RUN go build -o bin/registrator .

FROM scratch
COPY --from=builder /go/src/github.com/gliderlabs/registrator/bin/registrator /bin/registrator
Expand Down
11 changes: 0 additions & 11 deletions registrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ import (

"github.com/docker/docker/api/types/swarm"
dockerapi "github.com/fsouza/go-dockerclient"
"github.com/gliderlabs/pkg/usage"
"github.com/gliderlabs/registrator/bridge"
)

var Version string

var versionChecker = usage.NewChecker("registrator", Version)

var hostIp = flag.String("ip", "", "IP for ports mapped to the host")
var internal = flag.Bool("internal", false, "Use internal ports instead of published ones")
var explicit = flag.Bool("explicit", false, "Only register services which have SERVICE_NAME label set")
Expand Down Expand Up @@ -50,12 +45,6 @@ func assert(err error) {
}

func main() {
if len(os.Args) == 2 && os.Args[1] == "--version" {
versionChecker.PrintVersion()
os.Exit(0)
}
log.Printf("Starting registrator %s ...", Version)

flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
fmt.Fprintf(os.Stderr, " %s [options] <registry URI>\n\n", os.Args[0])
Expand Down

0 comments on commit b66cdda

Please sign in to comment.