1
0
Fork 0
mirror of https://github.com/Luzifer/cloudkeys-go.git synced 2024-11-08 14:10:05 +00:00

Improved Dockerfile and Makefile

closes #6
This commit is contained in:
Knut Ahlers 2015-10-28 13:47:31 +01:00
parent f4985f5cdb
commit 4b5dfd6933
4 changed files with 96 additions and 98 deletions

View file

@ -1,10 +1,14 @@
FROM scratch
FROM alpine
VOLUME /data
EXPOSE 3000
ENTRYPOINT ["/cloudkeys-go"]
ENV GOPATH /go
ENTRYPOINT ["/go/bin/cloudkeys-go"]
CMD ["--storage=local:////data", "--password-salt=changeme", "--username-salt=changeme"]
ADD https://rootcastore.hub.luzifer.io/v1/store/latest /etc/ssl/ca-bundle.pem
ADD ./cloudkeys-go /cloudkeys-go
ADD ./templates /templates
ADD . /go/src/github.com/Luzifer/cloudkeys-go
WORKDIR /go/src/github.com/Luzifer/cloudkeys-go
RUN apk --update add go git ca-certificates \
&& go get github.com/tools/godep \
&& /go/bin/godep go install -ldflags "-X main.version=$(git describe --tags)" \
&& apk --purge del git go

View file

@ -2,13 +2,12 @@ VERSION = $(shell git describe --tags)
default: build
build: bundle_assets
go build .
build: $(GOPATH)/bin/godep bindata.go
$(GOPATH)/bin/godep go build -ldflags "-X main.version=$(VERSION)" .
pre-commit: bundle_assets
pre-commit: bindata.go
container: bundle_assets
docker run -v $(CURDIR):/src -e LDFLAGS='-X main.version $(VERSION)' centurylink/golang-builder:latest
container: bindata.go
docker build .
gen_css:
@ -17,5 +16,8 @@ gen_css:
gen_js:
coffee --compile -o assets coffee/*.coffee
bundle_assets: gen_css gen_js
go-bindata assets templates
bindata.go: gen_css gen_js
go generate
$(GOPATH)/bin/godep:
go get github.com/tools/godep

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,7 @@
package main // import "github.com/Luzifer/cloudkeys-go"
//go:generate go-bindata assets templates
import (
"crypto/sha1"
"fmt"