Skip to content

Commit df7b541

Browse files
committed
automatically tag docker image based on hugo version and dockerfile version
1 parent d392c13 commit df7b541

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# change is that the Hugo version is now an overridable argument rather than a fixed
55
# environment variable.
66

7+
# Bump this by 1 whenever you change the Dockerfile below, e.g. if
8+
# `DOCKERFFILE_VERSION=1` then change this to `DOCKERFILE_VERSION=2` when you
9+
# change something else in this file.
10+
# DOCKERFILE_VERSION=0
11+
712
FROM alpine:latest
813

914
LABEL maintainer="Luc Perkins <[email protected]>"

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ NETLIFY_FUNC = $(NODE_BIN)/netlify-lambda
66
# but this can be overridden when calling make, e.g.
77
# CONTAINER_ENGINE=podman make container-image
88
CONTAINER_ENGINE ?= docker
9-
CONTAINER_IMAGE = kubernetes-hugo
9+
DOCKERFILE_VERSION = $(shell grep DOCKERFILE_VERSION Dockerfile | tail -n 1 | cut -d '=' -f 2 | tr -d " \"\n")
10+
CONTAINER_IMAGE = kubernetes-hugo:v$(HUGO_VERSION)-$(DOCKERFILE_VERSION)
1011
CONTAINER_RUN = $(CONTAINER_ENGINE) run --rm --interactive --tty --volume $(CURDIR):/src
1112

1213
CCRED=\033[0;31m

0 commit comments

Comments
 (0)