fredrikhgrelland / docker-hive

Apache License 2.0
2 stars 3 forks source link

Docker image tag for local testing #25

Closed zhenik closed 4 years ago

zhenik commented 4 years ago

Problem description

Invalid reference format if we use the branch name

~/Makefile

branch = $(shell git rev-parse --abbrev-ref HEAD)

build: custom_ca
    docker build . -t local/hive:$(branch)
    docker tag  local/hive:$(branch) local/hive:latest

Log

 ~/src/github.com/zhenik/docker-hive make build                                                                                                                  
docker build . -t local/hive:feature/refactor-to-r.0.2.2
invalid argument "local/hive:feature/refactor-to-r.0.2.2" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
make: *** [build] Error 125

Suggestion

I would suggest using last commit's hash

~/Makefile

branch = $(shell git rev-parse --verify HEAD) 
fredrikhgrelland commented 4 years ago

Ok with me.