Skip to content

Commit

Permalink
build: add labels to automate local build script
Browse files Browse the repository at this point in the history
Release-As: 1.1.0
Signed-off-by: iromli <[email protected]>
  • Loading branch information
iromli committed May 19, 2024
1 parent 9c0df78 commit 36b7cfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ ENV PATH="/opt/google-cloud-sdk/bin:/opt/spannerbox/bin:$PATH" \
SPANNER_DATABASE_ID=test-database \
SPANNER_EMULATOR_HOST=0.0.0.0:9010

LABEL org.opencontainers.image.url="iromli/spannerbox" \
org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.vendor="" \
org.opencontainers.image.version="1.1.0" \
org.opencontainers.image.title="Spannerbox" \
org.opencontainers.image.description="spannerbox is a set of tools to work with Spanner emulator"

ENTRYPOINT ["tini", "-g", "--"]
CMD ["emulator"]
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# default image name
IMAGE_NAME?=iromli/spannerbox
VERSION=$(shell cat version.txt | cut -d '-' -f 1)-dev
IMAGE_VERSION?=$(shell grep -Po 'org.opencontainers.image.version="\K.*?(?=")' Dockerfile)-dev
IMAGE_URL=$(shell grep -Po 'org.opencontainers.image.url="\K.*?(?=")' Dockerfile)
IMAGE?=${IMAGE_URL}:${IMAGE_VERSION}

.DEFAULT_GOAL:=build
.PHONY: test clean all build
.DEFAULT_GOAL := build

build:
@echo "[I] Building image ${IMAGE_NAME}:${VERSION}"
@docker build --rm --force-rm -t ${IMAGE_NAME}:${VERSION} .
@echo "[I] Building image ${IMAGE}"
@docker build --rm --force-rm -t ${IMAGE} .

0 comments on commit 36b7cfa

Please sign in to comment.