Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from microservices-demo/add_label_schema_0
Browse files Browse the repository at this point in the history
Adds label-schema.org docker LABELs
  • Loading branch information
pidster authored Sep 19, 2016
2 parents 3be32ee + ac81c39 commit 3ecd225
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _testmain.go
### Java template
/target/
*.class
*.jar

# Mobile Tools for Java (J2ME)
.mtj.tmp/
Expand Down
14 changes: 14 additions & 0 deletions docker/shipping/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: Shipping" \
org.label-schema.description="REST API for Shipping service" \
org.label-schema.url="https://github.com/microservices-demo/shipping" \
org.label-schema.vcs-url="github.com:microservices-demo/shipping.git" \
org.label-schema.vcs-ref="${COMMIT}" \
org.label-schema.docker.schema-version="1.0"

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/urandom","-jar","./app.jar", "--port=80"]
9 changes: 8 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,5 +30,9 @@ cp $CODE_DIR/target/*.jar $CODE_DIR/docker/$(basename $CODE_DIR)

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;

0 comments on commit 3ecd225

Please sign in to comment.