From d0825157f0e810449267591fbf7e538f00995b81 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Mon, 27 Sep 2021 14:07:49 -0700 Subject: [PATCH] updates --- Dockerfile | 18 ++++++++---------- Makefile | 10 ++++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile index 2f5c7c6..caedf3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,15 @@ -FROM golang:1.13-alpine3.11 AS builder +FROM golang:1.17-alpine3.14 AS builder -RUN mkdir -p /src/src WORKDIR /usr/src +ARG GOOGLE_CLOUD_GO_VERSION +ENV GOOGLE_CLOUD_GO_VERSION $GOOGLE_CLOUD_GO_VERSION -ENV GOOGLE_CLOUD_GO_VERSION v0.51.0 +RUN busybox wget "https://github.com/googleapis/google-cloud-go/archive/${GOOGLE_CLOUD_GO_VERSION}.tar.gz" -O- | \ + busybox tar x --strip-components 1 -zf - && \ + cd bigtable && \ + go install -v ./cmd/emulator -RUN apk add --no-cache git - -RUN git clone --depth=1 --branch="$GOOGLE_CLOUD_GO_VERSION" https://github.com/googleapis/google-cloud-go.git . \ - && cd bigtable \ - && go install -v ./cmd/emulator - -FROM alpine:3.11 +FROM alpine:3.14 COPY --from=builder /go/bin/emulator /bin/cbtemulator diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8e5467c --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +VERSION := 23c02d92c7a1747068eb1fc57dddbad23907d614 + +build: + docker build -t us.gcr.io/sentryio/cbtemulator:$(VERSION) --build-arg=GOOGLE_CLOUD_GO_VERSION=$(VERSION) . + +# Ideally craft's set up to release to here, but some ops people +# have permissions to push to the sentryio project, and +# cbtemulator doesn't really need updates often. +publish: build + docker push us.gcr.io/sentryio/cbtemulator:$(VERSION)