Upgrade alpine and add timezone (#289)

This commit is contained in:
andig 2020-08-15 23:22:29 +02:00 • committed by GitHub
parent b2c2aa2008
commit 5d04941cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 18 deletions

View file

@ -23,16 +23,18 @@ RUN make clean install assets build
# STEP 2 build a small image including module support
#
FROM alpine:3.11
FROM alpine:3.12
WORKDIR /evcc
ENV TZ=Europe/Berlin
# Import from builder
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/evcc /usr/local/bin/evcc
COPY bin/* /evcc/
COPY docker/bin/* /evcc/
# UI and /api
EXPOSE 7070/tcp

View file

@ -1,11 +1,13 @@
.PHONY: default clean install lint test assets build binaries publish-images test-release release
.PHONY: default clean install lint test assets build binaries test-release release publish-testing publish-latest publish-images
TAG_NAME := $(shell git describe --abbrev=0 --tags)
SHA := $(shell git rev-parse --short HEAD)
VERSION := $(if $(TAG_NAME),$(TAG_NAME),$(SHA))
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
ALPINE := 3.12
TARGETS := arm.v6,arm.v8,amd64
default: clean install assets lint test build
clean:
@ -31,20 +33,23 @@ build:
@echo Version: $(VERSION) $(BUILD_DATE)
go build -v -tags=release -ldflags '-X "github.com/andig/evcc/server.Version=${VERSION}" -X "github.com/andig/evcc/server.Commit=${SHA}"'
test-images:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish -v "testing" --image-name andig/evcc --base-runtime-image alpine --dry-run=false --targets=amd64
publish-images:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish -v "$(TAG_NAME)" -v "latest" --image-name andig/evcc --base-runtime-image alpine --dry-run=false --targets=arm.v6,arm.v8,amd64
publish-latest:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish -v "latest" --image-name andig/evcc --base-runtime-image alpine --dry-run=false --targets=arm.v6,arm.v8,amd64
test-release:
release-test:
goreleaser --snapshot --skip-publish --rm-dist
release:
goreleaser --rm-dist
publish-testing:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:$(ALPINE) \
--image-name andig/evcc -v "testing" --targets=amd64
publish-latest:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:$(ALPINE) \
--image-name andig/evcc -v "latest" --targets=$(TARGETS)
publish-images:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:$(ALPINE) \
--image-name andig/evcc -v "latest" -v "$(TAG_NAME)" --targets=$(TARGETS)

View file

@ -24,12 +24,14 @@ RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} make build
#############################
FROM {{ .RuntimeImage }}
ENV TZ=Europe/Berlin
# Import from builder
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/evcc /usr/local/bin/evcc
COPY bin/* /evcc/
COPY docker/bin/* /evcc/
EXPOSE 7070