From 936a77efe2f70bda5e11b2a890276a26aa64c614 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 20 Apr 2022 15:30:50 +0200 Subject: [PATCH] Add Docker image publication recipe --- Makefile | 14 ++++++++++++++ misc/dokku/Dockerfile | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 88608ff..4a91d79 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ DOKKU_HOST := dokku@dev.lookingfora.name SHELL := /bin/bash +DOCKER_IMAGE_NAME ?= bornholm/oidc-test +DOCKER_IMAGE_TAG ?= $(shell git describe) build: CGO_ENABLED=0 go build -v -o ./bin/server ./cmd/server @@ -37,4 +39,16 @@ dokku-deploy: $(if $(shell git config remote.dokku-oidc-test.url),, git remote add dokku-oidc-test $(DOKKU_HOST):oidc-test) git push -f dokku-oidc-test $(shell git rev-parse HEAD):refs/heads/master +docker-build: + docker build \ + -f ./misc/dokku/Dockerfile \ + -t $(DOCKER_IMAGE_NAME):latest \ + . + +docker-release: docker-build + docker image tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) + docker login + docker push $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) + docker push $(DOCKER_IMAGE_NAME):latest + .PHONY: lint watch build vendor tidy release \ No newline at end of file diff --git a/misc/dokku/Dockerfile b/misc/dokku/Dockerfile index 5ed86a3..d7b2ccd 100644 --- a/misc/dokku/Dockerfile +++ b/misc/dokku/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13 AS build +FROM golang:1.17 AS build ARG HTTP_PROXY= ARG HTTPS_PROXY=