From 6449f8100e51337c60368086c2b07ae6be6c3101 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Fri, 27 Nov 2020 17:23:54 -0800 Subject: [PATCH] switch to debian:buster slim and install make --- .drone.yml | 8 +++++++- Makefile | 6 +++--- build/build.sh | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 90190e2..5083add 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: default steps: - name: make - image: docker:dind + image: debian:buster-slim environment: USERNAME: from_secret: docker_username @@ -12,11 +12,17 @@ steps: from_secret: docker_password REGISTRY: from_secret: docker_registry + DOCKERVERSION: "19.03.9" volumes: - name: dockersock path: /var/run commands: + - apt-get update && apt install -y --no-install-recommends curl make ca-certificates git + - curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-$${DOCKERVERSION}.tgz + - tar xzvf docker-$${DOCKERVERSION}.tgz --strip 1 -C /usr/local/bin docker/docker + - rm docker-$${DOCKERVERSION}.tgz - sleep 5 # give docker enough time to start + - echo login $REGISTRY - docker login -u $USERNAME -p $PASSWORD $REGISTRY - make manifest-list - name: notify diff --git a/Makefile b/Makefile index 49dee6d..836dddc 100755 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ BASEIMAGE ?= scratch # gcr.io/distroless/static TAG := $(VERSION)__$(OS)_$(ARCH) -BUILD_IMAGE ?= golang:1.14-alpine +BUILD_IMAGE ?= golang:1.15.5-alpine BIN_EXTENSION := ifeq ($(OS), windows) @@ -137,7 +137,6 @@ go-build: $(BUILD_DIRS) @mkdir -p "$$(pwd)/.go/bin/$(OS)_$(ARCH)" @chmod $(BINDIRMODE) "$$(pwd)/.go/bin/$(OS)_$(ARCH)" @docker run \ - -i \ --rm \ -u $$(id -u):$$(id -g) \ -v $$(pwd):/src \ @@ -212,7 +211,8 @@ push: $(CONTAINER_DOTFILES) # TODO: Upstream was using manifest-tool and gcloud commands. Needs update manifest-list: # @HELP builds a manifest list of containers for all platforms manifest-list: all-container - @for bin in $(BINS); do \ + @export DOCKER_CLI_EXPERIMENTAL=enabled && \ + for bin in $(BINS); do \ docker manifest create $(REGISTRY)/$$bin:$(VERSION); \ for platform in $(ALL_PLATFORMS); do \ docker manifest add --arch $$(echo $$platform | cut -d/ -f2) \ diff --git a/build/build.sh b/build/build.sh index 295b5bb..4111a84 100755 --- a/build/build.sh +++ b/build/build.sh @@ -35,7 +35,7 @@ export CGO_ENABLED=0 export GOARCH="${ARCH}" export GOOS="${OS}" export GO111MODULE=on -export GOFLAGS="-mod=vendor" +export GOFLAGS="-mod=mod" go install \ -installsuffix "static" \