From 7004aa2d93d70619188cdad59213aca1efa50e23 Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Wed, 30 Mar 2022 22:24:40 +1100 Subject: [PATCH] Revert "chore: add build target to Makefile & builder to Dockerfile" (#218) * Revert "chore: add build target to Makefile & builder to Dockerfile (#215)" This reverts commit de88bc221ae62679786b203475dda16fefcf6803. * fix: generate image from current commit goreleaser was using the latest commit to master instead of the PR. * chore: getting goreleaser to play nice --- Dockerfile | 23 ++--------------------- Makefile | 5 +---- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a6d9f9..f46524d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,10 @@ -# Build the binary -FROM docker.io/library/golang:1.18 as builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY main.go main.go -COPY cmd/ cmd/ -COPY phpfpm/ phpfpm/ - -# Build -RUN CGO_ENABLED=0 go build -a -o php-fpm_exporter main.go - -FROM docker.io/library/alpine:3.15.0 +FROM alpine:3.15.0 ARG BUILD_DATE ARG VCS_REF ARG VERSION -COPY --from=builder /workspace/php-fpm_exporter . +COPY php-fpm_exporter / EXPOSE 9253 ENTRYPOINT [ "/php-fpm_exporter", "server" ] diff --git a/Makefile b/Makefile index 25baec9..59ed2a9 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,6 @@ help: ## List targets & descriptions deps: ## Get dependencies go get -d -v ./... -build: deps ## Build the binary - go build -a -o php-fpm_exporter main.go - test: ## Run tests go test -short ./... @@ -29,4 +26,4 @@ lint: ## Run linters golangci-lint run fmt: ## Fix formatting issues - goimports -w . \ No newline at end of file + goimports -w .