forked from deegree/deegree3
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from stempler/master-3.3.18-we
configure for publishing in wetransform artifactory
- Loading branch information
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM java:7-jdk as builder | ||
# Multi stage build - https://docs.docker.com/engine/userguide/eng-image/multistage-build/ | ||
|
||
# install maven | ||
RUN apt-get update && apt-get install -y --no-install-recommends maven | ||
|
||
# build and extract deegree | ||
RUN mkdir /build && mkdir /target | ||
COPY ./ /build/ | ||
RUN cd /build/ && \ | ||
mvn clean install -DskipTests && \ | ||
cp /build/deegree-services/deegree-webservices/target/deegree-webservices-*.war /build/deegree-webservices.war && \ | ||
unzip -o /build/deegree-webservices.war -d /target | ||
|
||
# add to image... | ||
FROM tomcat:8.0-jre7 | ||
ENV LANG en_US.UTF-8 | ||
|
||
# add build info - see hooks/build and http://label-schema.org/ | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG VCS_URL | ||
LABEL org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.vcs-url=$VCS_URL \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.schema-version="1.0.0-rc1" | ||
|
||
EXPOSE 8080 | ||
|
||
# set default secrets ( override for production use! ) | ||
# consoleSecretKey="deegree" | ||
ENV consoleSecretKey=000001544E797221:564344F65B8F9DDBA6A410E461E7801E10955F56D8679284966F400C68B6CEAB | ||
ENV apiUser=deegree | ||
ENV apiPass=deegree | ||
|
||
RUN mkdir /root/.deegree && \ | ||
rm -r /usr/local/tomcat/webapps/ROOT | ||
|
||
COPY --from=builder /target /usr/local/tomcat/webapps/ROOT | ||
|
||
#cmd: | ||
# 1. configure deegreeapi access | ||
# 2. configure console access | ||
# 3. start tomcat | ||
CMD sed -i '44i <user username="'"$apiUser"'" password="'"$apiPasswd"'" roles="deegree" \/> /' /usr/local/tomcat/conf/tomcat-users.xml \ | ||
&& echo $consoleSecretKey >/root/.deegree/console.pw \ | ||
&& /usr/local/tomcat/bin/catalina.sh run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# simple compose file for running the Docker image | ||
deegree: | ||
build: . | ||
ports: | ||
- "8080:8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# see https://medium.com/microscaling-systems/labelling-automated-builds-on-docker-hub-f3d073fb8e1 | ||
# and https://docs.docker.com/docker-cloud/builds/advanced/#override-build-test-or-push-commands | ||
|
||
# $IMAGE_NAME var is injected into the build so the tag is correct. | ||
|
||
echo "Build hook running" | ||
docker build \ | ||
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ | ||
--build-arg VCS_REF=`git rev-parse HEAD` \ | ||
--build-arg VCS_URL=`git ls-remote --get-url origin` \ | ||
-t $IMAGE_NAME . | ||
|
||
# Other options for getting VCS URL: | ||
# git remote get-url origin # seems to be not available on Docker Hub | ||
# git config --get remote.origin.url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters