-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add labels to automate local build script
Release-As: 1.1.0 Signed-off-by: iromli <[email protected]>
- Loading branch information
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} . |