Skip to content

Commit

Permalink
Cleanup build of nginx image (#5085)
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored Feb 15, 2020
1 parent 12314aa commit 36a8134
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions images/nginx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.DEFAULT_GOAL:=container

# set default shell
SHELL=/bin/bash -o pipefail

# 0.0.0 shouldn't clobber any released builds
TAG ?= 0.98
REGISTRY ?= quay.io/kubernetes-ingress-controller
Expand All @@ -25,34 +30,26 @@ EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
COMMA := ,

.PHONY: all
all: container

.PHONY: container
container:
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build \
--no-cache \
--progress plain \
--platform $(subst $(SPACE),$(COMMA),$(PLATFORMS)) \
--tag $(IMAGE):$(TAG) rootfs

# https://github.com/docker/buildx/issues/59
$(foreach PLATFORM,$(PLATFORMS), \
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build \
--load \
--progress plain \
--platform $(PLATFORM) \
--tag $(IMAGE)-$(PLATFORM):$(TAG) rootfs;)
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build \
--load \
--progress plain \
--platform $(PLATFORM) \
--tag $(IMAGE)-$(PLATFORM):$(TAG) rootfs;)

.PHONY: push
push: container
$(foreach PLATFORM,$(PLATFORMS), \
docker push $(IMAGE)-$(PLATFORM):$(TAG);)

ifeq ($(ARCH), amd64)
docker push $(IMAGE):$(TAG)
endif

.PHONY: release
release: push
echo "done"
Expand Down

0 comments on commit 36a8134

Please sign in to comment.