Skip to content

Commit

Permalink
New docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
bcessa committed Nov 7, 2020
1 parent b382f9d commit d3938c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,9 +1,9 @@
FROM docker.pkg.github.com/bryk-io/base-images/shell:0.1.0
FROM ghcr.io/bryk-io/shell:0.1.0

# Expose required ports and volumes
VOLUME ["/tmp", "/etc/govanity"]
EXPOSE 9090/tcp

# Add application binary and use it as default entrypoint
COPY govanity_linux_amd64 /usr/bin/govanity
COPY govanity /usr/bin/govanity
ENTRYPOINT ["/usr/bin/govanity"]
15 changes: 8 additions & 7 deletions Makefile
Expand Up @@ -3,13 +3,13 @@

# Project setup
BINARY_NAME=govanity
DOCKER_IMAGE=docker.pkg.github.com/bryk-io/go-vanity/govanity
DOCKER_IMAGE=ghcr.io/bryk-io/govanity
MAINTAINERS='Ben Cessa <ben@pixative.com>'

# State values
GIT_COMMIT_DATE=$(shell TZ=UTC git log -n1 --pretty=format:'%cd' --date='format-local:%Y-%m-%dT%H:%M:%SZ')
GIT_COMMIT_HASH=$(shell git log -n1 --pretty=format:'%H')
GIT_TAG=$(shell git describe --tags --always --abbrev=0 | cut -c 1-8)
GIT_TAG=$(shell git describe --tags --always --abbrev=0 | cut -c 1-7)

# Linker tags
# https://golang.org/cmd/link/
Expand Down Expand Up @@ -55,15 +55,16 @@ clean:
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
docker:
make build-for os=linux arch=amd64
@-docker rmi $(DOCKER_IMAGE):$(GIT_TAG)
mv $(BINARY_NAME)_linux_amd64 $(BINARY_NAME)
@-docker rmi $(DOCKER_IMAGE):$(GIT_TAG:v%=%)
@docker build \
"--label=org.opencontainers.image.title=$(BINARY_NAME)" \
"--label=org.opencontainers.image.authors=$(MAINTAINERS)" \
"--label=org.opencontainers.image.created=$(GIT_COMMIT_DATE)" \
"--label=org.opencontainers.image.revision=$(GIT_COMMIT_HASH)" \
"--label=org.opencontainers.image.version=$(GIT_TAG)" \
--rm -t $(DOCKER_IMAGE):$(GIT_TAG) .
@rm $(BINARY_NAME)_linux_amd64
"--label=org.opencontainers.image.version=$(GIT_TAG:v%=%)" \
--rm -t $(DOCKER_IMAGE):$(GIT_TAG:v%=%) .
@rm $(BINARY_NAME)

## install: Install the binary to GOPATH and keep cached all compiled artifacts
install:
Expand All @@ -81,7 +82,7 @@ release:
## scan: Look for known vulnerabilities in the project dependencies
# https://github.com/sonatype-nexus-community/nancy
scan:
@nancy -quiet go.sum
@go list -f '{{if not .Indirect}}{{.}}{{end}}' -mod=mod -m all | nancy sleuth -o text

## test: Run unit tests excluding the vendor dependencies
test:
Expand Down
2 changes: 1 addition & 1 deletion helm/govanity/Chart.yaml
Expand Up @@ -3,7 +3,7 @@ name: govanity
description: Go vanity URLs server
type: application
version: 0.1.3
appVersion: 0.1.2
appVersion: 0.1.3
home: https://github.com/bryk-io/go-vanity
icon: https://raw.githubusercontent.com/bryk-io/go-vanity/master/helm/govanity/icon.png
sources:
Expand Down

0 comments on commit d3938c6

Please sign in to comment.