Skip to content

Instantly share code, notes, and snippets.

@xcoulon
Created January 30, 2018 19:45
Show Gist options
  • Save xcoulon/99a4fb8e863282a6c7ce3b73167e7055 to your computer and use it in GitHub Desktop.
Save xcoulon/99a4fb8e863282a6c7ce3b73167e7055 to your computer and use it in GitHub Desktop.
$(eval BUILD_COMMIT:=$(shell git rev-parse --short HEAD))
$(eval BUILD_TIME:=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ'))
docker build --build-arg POSTGRES_HOST=`cat .tmp/postgres.host` \
--build-arg POSTGRES_PORT=`cat .tmp/postgres.port` \
--build-arg POSTGRES_PASSWORD=$(POSTGRES_PASSWORD) \
--build-arg BUILD_COMMIT=$(BUILD_COMMIT) \
--build-arg BUILD_TIME=$(BUILD_TIME) \
. \
-t xcoulon/go-url-shortener:$(BUILD_COMMIT)
docker tag xcoulon/go-url-shortener:$(BUILD_COMMIT) xcoulon/go-url-shortener:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment