Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go and Alpine updates #708

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
build
release
vendor
registrator
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM golang:1.9.4-alpine3.7 AS builder
FROM golang:1.19.1-alpine3.16 AS builder

WORKDIR /go/src/github.com/gliderlabs/registrator/

COPY . .
RUN \
apk add --no-cache curl git \
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
&& dep ensure -vendor-only \
&& CGO_ENABLED=0 GOOS=linux go build \
-a -installsuffix cgo \
-ldflags "-X main.Version=$(cat VERSION)" \
-o bin/registrator \
.
RUN apk --no-cache add -t build-deps build-base git curl ca-certificates
RUN CGO_ENABLED=0 GOOS=linux \
go mod init && \
go mod tidy && \
go mod vendor && \
go build -a -installsuffix cgo -ldflags "-X main.Version=$(cat VERSION)" -o bin/registrator .

FROM alpine:3.16

FROM alpine:3.7
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/src/github.com/gliderlabs/registrator/bin/registrator /bin/registrator

Expand Down
24 changes: 14 additions & 10 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM alpine:3.7
FROM golang:1.19.1-alpine3.16

CMD ["/bin/registrator"]

COPY . /go/src/github.com/gliderlabs/registrator
RUN apk --no-cache add -t build-deps build-base go git curl \
&& apk --no-cache add ca-certificates \
&& export GOPATH=/go && mkdir -p /go/bin && export PATH=$PATH:/go/bin \
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
&& cd /go/src/github.com/gliderlabs/registrator \
&& export GOPATH=/go \
&& git config --global http.https://gopkg.in.followRedirects true \
&& dep ensure \
&& go build -ldflags "-X main.Version=dev" -o /bin/registrator

RUN apk --no-cache add build-base git curl ca-certificates

WORKDIR /go/src/github.com/gliderlabs/registrator
RUN export GOPATH=/go && \
export PATH=$PATH:/go/bin && \
git config --global http.https://gopkg.in.followRedirects true

RUN go mod init && \
go mod tidy && \
go mod vendor
RUN go build -ldflags "-X main.Version=dev" -o /bin/registrator
316 changes: 0 additions & 316 deletions Gopkg.lock

This file was deleted.

Loading