Skip to content

Commit 63c7607

Browse files
committed
Testing docker hooks
1 parent 9afe8cb commit 63c7607

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
FROM alpine:3.8
1+
FROM alpine:3.12
2+
ARG BUILD_DATE
3+
ARG VCS_REF
4+
ARG VERSION
5+
LABEL org.label-schema.build-date=$BUILD_DATE \
6+
org.label-schema.vcs-ref=$VCS_REF \
7+
org.label-schema.vcs-url="https://github.com/chentex/random-logger" \
8+
org.label-schema.version=$VERSION
29
RUN apk add --no-cache bc
310
COPY ./entrypoint.sh /
411
ENTRYPOINT ["/entrypoint.sh"]

hooks/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

hooks/build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
export VERSION=$(cat hooks/VERSION)
4+
5+
docker build --build-arg VCS_REF=`git rev-parse —-short HEAD` \
6+
--build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` \
7+
--build-arg VERSION=$VERSION \
8+
-f Dockerfile -t chentex/random-logger:$VERSION

0 commit comments

Comments
 (0)