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

Commit

Permalink
Fix env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
pidster committed Sep 19, 2016
1 parent 328ff93 commit ac81c39
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
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
11 changes: 8 additions & 3 deletions docker/shipping/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +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.url="https://github.com/microservices-demo/shipping" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.version="${BUILD_VERSION}" \
org.label-schema.name="Socks Shop: Shipping" \
org.label-schema.version="${RELEASE_VERSION}" \
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.build-date="${BUILD_DATE}" \
org.label-schema.docker.schema-version="1.0"

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/urandom","-jar","./app.jar", "--port=80"]
8 changes: 6 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ev

export RELEASE_VERSION="0.0.2-SNAPSHOT"
export BUILD_VERSION="0.0.2-SNAPSHOT"
export BUILD_DATE=`date +%Y-%m-%dT%T%z`

SCRIPT_DIR=$(dirname "$0")
Expand Down Expand Up @@ -30,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 ac81c39

Please sign in to comment.