Skip to content

Commit

Permalink
fix cli params not being passed to app binary
Browse files Browse the repository at this point in the history
  • Loading branch information
zuc committed Jun 6, 2018
1 parent 691ee52 commit 6e72844
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
7 changes: 3 additions & 4 deletions cli-only/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ ENV MOJITO_VERSION 0.83
RUN apt-get update && \
apt-get install -y curl gettext-base

RUN mkdir -p /opt/mojito/bin && \
mkdir -p /opt/mojito/conf && \
curl -L https://github.com/box/mojito/releases/download/v${MOJITO_VERSION}/mojito-cli-${MOJITO_VERSION}.jar > /opt/mojito/bin/cli.jar
RUN mkdir -p /opt/mojito && \
curl -L https://github.com/box/mojito/releases/download/v${MOJITO_VERSION}/mojito-cli-${MOJITO_VERSION}.jar > /opt/mojito/cli.jar

COPY application.properties.dist /opt/mojito/conf/
COPY application.properties.dist /opt/mojito/
COPY mojito-cli-entrypoint.sh /opt/

ENTRYPOINT ["/opt/mojito-cli-entrypoint.sh"]
6 changes: 3 additions & 3 deletions cli-only/mojito-cli-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

set -e
cd /opt/mojito/conf/
cd /opt/mojito

# Env vars interpolation
envsubst < application.properties.dist > application.properties
rm application.properties.dist

# Go!
cd /opt/mojito/bin/
exec java -jar cli.jar --spring.config.location=/opt/mojito/conf/application.properties $@
mkdir -p /opt/mojito/workdir && cd /opt/mojito/workdir
exec java -jar /opt/mojito/cli.jar $@
9 changes: 4 additions & 5 deletions full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ ENV MOJITO_VERSION 0.83
RUN apt-get update && \
apt-get install -y curl gettext-base

RUN mkdir -p /opt/mojito/bin && \
mkdir -p /opt/mojito/conf && \
curl -L https://github.com/box/mojito/releases/download/v${MOJITO_VERSION}/mojito-cli-${MOJITO_VERSION}.jar > /opt/mojito/bin/cli.jar && \
curl -L https://github.com/box/mojito/releases/download/v${MOJITO_VERSION}/mojito-webapp-${MOJITO_VERSION}.jar > /opt/mojito/bin/webapp.jar
RUN mkdir -p /opt/mojito && \
curl -L https://github.com/box/mojito/releases/download/v${MOJITO_VERSION}/mojito-cli-${MOJITO_VERSION}.jar > /opt/mojito/cli.jar && \
curl -L https://github.com/box/mojito/releases/download/v${MOJITO_VERSION}/mojito-webapp-${MOJITO_VERSION}.jar > /opt/mojito/webapp.jar

COPY application.properties.dist /opt/mojito/conf/
COPY application.properties.dist /opt/mojito/
COPY mojito-webapp-launcher.sh /opt/

EXPOSE 8080
Expand Down
6 changes: 3 additions & 3 deletions full/mojito-webapp-launcher.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

set -e
cd /opt/mojito/conf/
cd /opt/mojito

# Env vars interpolation
envsubst < application.properties.dist > application.properties
rm application.properties.dist

# Go!
cd /opt/mojito/bin/
exec java -XX:MaxPermSize=128m -Xmx1024m -jar webapp.jar --spring.config.location=/opt/mojito/conf/application.properties
mkdir -p /opt/mojito/workdir && cd /opt/mojito/workdir
exec java -XX:MaxPermSize=128m -Xmx1024m -jar /opt/mojito/webapp.jar

0 comments on commit 6e72844

Please sign in to comment.