Skip to content

Commit

Permalink
Revert "chore: add build target to Makefile & builder to Dockerfile (#…
Browse files Browse the repository at this point in the history
…215)"

This reverts commit de88bc2.
  • Loading branch information
estahn authored Mar 30, 2022
1 parent 14076ae commit 98dcd6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
23 changes: 2 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...

Expand All @@ -29,4 +26,4 @@ lint: ## Run linters
golangci-lint run

fmt: ## Fix formatting issues
goimports -w .
goimports -w .

0 comments on commit 98dcd6d

Please sign in to comment.