diff --git a/Dockerfile b/Dockerfile index 796744d..78050cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,11 @@ -FROM alpine:3.8 +FROM alpine:3.12 +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/chentex/random-logger" \ + org.label-schema.version=$VERSION RUN apk add --no-cache bc COPY ./entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] diff --git a/LICENSE b/LICENSE index 74377e9..be597d4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Vicente Zepeda +Copyright (c) 2020 Vicente Zepeda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/hooks/VERSION b/hooks/VERSION new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/hooks/VERSION @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file diff --git a/hooks/build b/hooks/build new file mode 100755 index 0000000..a6f382c --- /dev/null +++ b/hooks/build @@ -0,0 +1,9 @@ +#!/bin/bash + +export VERSION=$(cat hooks/VERSION) +export IMAGE_NAME="chentex/random-logger" + +docker build --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` \ + --build-arg VERSION=$VERSION \ + -f Dockerfile -t $IMAGE_NAME:v$VERSION -t $IMAGE_NAME:latest . \ No newline at end of file