Skip to content

Commit 0c28bce

Browse files
committed
Revert "feat(makefile): add docker buildx support (CrunchyData#72)"
This reverts commit 431ff9d. Unfortunately the PR broke builds for RHEL7 which is an important platform for us. If buildx support can be brought in without issues, we're open to a new PR. cc/ @awill1988 @crunchyheath
1 parent b9ac8b9 commit 0c28bce

File tree

3 files changed

+18
-55
lines changed

3 files changed

+18
-55
lines changed

.cnf.makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
# Lightweight Alpine-based pg_tileserv Docker Image
2-
# Author: Just van den Broecke
3-
FROM golang:1.15.5
4-
5-
# Build ARGS
6-
ARG VERSION
7-
8-
RUN mkdir /app
9-
ADD . /app/
10-
WORKDIR /app
11-
RUN go build -v -ldflags "-s -w -X main.programVersion=${VERSION}" \
12-
&& chmod +x ./pg_tileserv
13-
141
# copy build result to a centos base image to match other
152
# crunchy containers
163
FROM centos:7
174
RUN mkdir /app
18-
COPY --from=0 /app/assets /app/assets
19-
COPY --from=0 /app/pg_tileserv /app/pg_tileserv
5+
ADD ./pg_tileserv /app/
6+
ADD ./assets /app/assets
7+
8+
ARG VERSION
209

2110
LABEL vendor="Crunchy Data" \
2211
url="https://crunchydata.com" \

Makefile

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
1-
include .cnf.makefile
21

2+
APPVERSION := latest
33
GOVERSION := 1.15
44
PROGRAM := pg_tileserv
55
CONFIG := config/$(PROGRAM).toml
6+
CONTAINER := pramsey/$(PROGRAM)
67

78
RM = /bin/rm
89
CP = /bin/cp
910
MKDIR = /bin/mkdir
1011

11-
.PHONY: bin-docker build-docker buildx-docker build check clean docs install install-buildx release test uninstall
12+
.PHONY: bin-docker build-docker build check clean docs install release test uninstall
1213

1314
.DEFAULT_GOAL := help
1415

1516
GOFILES := $(wildcard *.go)
1617

1718
all: $(PROGRAM)
1819

19-
check: ## This checks the current version of Go installed locally
20+
check: ## This checks the current version of Go installed locally
2021
@go version
2122

22-
clean: ## This will clean all local build artifacts
23+
clean: ## This will clean all local build artifacts
2324
$(info Cleaning project...)
2425
@rm -f $(PROGRAM)
2526
@rm -rf docs/*
2627
docker image prune --force
2728

28-
docs: ## Generate docs
29+
docs: ## Generate docs
2930
@rm -rf docs/* && cd hugo && hugo && cd ..
3031

31-
build: $(GOFILES) ## Build a local binary using APPVERSION parameter or CI as default
32+
build: $(GOFILES) ## Build a local binary using APPVERSION parameter or CI as default
3233
go build -v -ldflags "-s -w -X main.programVersion=$(APPVERSION)"
3334

34-
bin-docker: ## Build a local binary based off of a golang base docker image
35+
bin-docker: ## Build a local binary based off of a golang base docker image
3536
sudo docker run --rm -v "$(PWD)":/usr/src/myapp:z -w /usr/src/myapp golang:$(GOVERSION) make APPVERSION=$(APPVERSION) build
3637

37-
build-docker: $(PROGRAM) Dockerfile ## Generate a CentOS 7 container with APPVERSION tag, using binary from current environment
38-
docker build -f $(DOCKERFILE) --build-arg VERSION=$(APPVERSION) -t $(REPO)/$(PROGRAM):$(APPVERSION) .
38+
build-docker: $(PROGRAM) Dockerfile ## Generate a CentOS 7 container with APPVERSION tag, using binary from current environment
39+
docker build -f Dockerfile --build-arg VERSION=$(APPVERSION) -t $(CONTAINER):$(APPVERSION) .
3940

40-
buildx-docker: ## Compiles multi-arch images and pushes them to a custom repository
41-
docker buildx build -f $(DOCKERFILE) --platform=$(BUILDPLATFORM) --build-arg VERSION=$(APPVERSION) -t $(REPO)/$(PROGRAM):$(APPVERSION) --push .
41+
release: clean docs build build-docker ## Generate the docs, a local build, and then uses the local build to generate a CentOS 7 container
4242

43-
release: clean docs build build-docker ## Generate the docs, a local build, and then uses the local build to generate a CentOS 7 container
44-
45-
test: ## Run the tests locally
43+
test: ## Run the tests locally
4644
go test -v
4745

4846
$(CONFIG): $(CONFIG).example
@@ -57,16 +55,12 @@ install: $(PROGRAM) docs $(CONFIG) ## This will install the program local
5755
$(CP) -r assets $(DESTDIR)/usr/share/$(PROGRAM)/assets
5856
$(CP) -r docs $(DESTDIR)/usr/share/$(PROGRAM)/docs
5957

60-
install-buildx: ## This will install the buildx plugin for docker depending on the system
61-
wget -nc --quiet https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.$(uname_S)-$(ARCH) -P ~/.docker/cli-plugins -O docker-buildx
62-
chmod a+x ~/.docker/cli-plugins/docker-buildx
63-
64-
uninstall: ## This will uninstall the program from your local system
58+
uninstall: ## This will uninstall the program from your local system
6559
$(RM) $(DESTDIR)/usr/bin/$(PROGRAM)
6660
$(RM) $(DESTDIR)/etc/$(PROGRAM).toml
6761
$(RM) -r $(DESTDIR)/usr/share/$(PROGRAM)
6862

69-
help: ## Prints this help message
63+
help: ## Prints this help message
7064
@echo ""
7165
@echo ""
7266
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/:.*##/:/'

0 commit comments

Comments
 (0)