Commit 038527e2 authored by Pid's avatar Pid Committed by GitHub

Merge pull request #9 from microservices-demo/add_label_schema_0

Add label schema labels
parents 14599cdd d33de69d
......@@ -3,4 +3,18 @@ FROM java:openjdk-8-alpine
WORKDIR /usr/src/app
COPY *.jar ./app.jar
ARG BUILD_DATE
ARG BUILD_VERSION
ARG COMMIT
LABEL org.label-schema.vendor="Weaveworks" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.version="${BUILD_VERSION}" \
org.label-schema.name="Socks Shop: Cart" \
org.label-schema.description="REST API for Cart service" \
org.label-schema.url="https://github.com/microservices-demo/carts" \
org.label-schema.vcs-url="github.com:microservices-demo/carts.git" \
org.label-schema.vcs-ref="${COMMIT}" \
org.label-schema.schema-version="1.0"
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/urandom","-jar","./app.jar", "--port=80"]
......@@ -2,6 +2,9 @@
set -ev
export BUILD_VERSION="0.0.2-SNAPSHOT"
export BUILD_DATE=`date +%Y-%m-%dT%T%z`
SCRIPT_DIR=$(dirname "$0")
if [[ -z "$GROUP" ]] ; then
......@@ -27,5 +30,9 @@ cp $CODE_DIR/target/*.jar $CODE_DIR/docker/cart
for m in ./docker/*/; do
REPO=${GROUP}/$(basename $m)
$DOCKER_CMD build -t ${REPO}:${COMMIT} $CODE_DIR/$m;
$DOCKER_CMD build \
--build-arg BUILD_VERSION=$BUILD_VERSION \
--build-arg BUILD_DATE=$BUILD_DATE \
--build-arg COMMIT=$COMMIT \
-t ${REPO}:${COMMIT} $CODE_DIR/$m;
done;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment