-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
75 additions
and
38 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 |
---|---|---|
@@ -1,33 +1,49 @@ | ||
FROM maven:3.6.3-jdk-11 AS maven | ||
# building minimal jdk | ||
FROM alpine:3.10.1 AS base | ||
|
||
RUN git clone https://github.com/tamada/pochi.git \ | ||
&& cd pochi | ||
&& mvn package | ||
&& unzip distribution/target/pochi-1.0.0-dist.zip -d ../ | ||
&& /usr/local/openjdk-11/bin/jlink \ | ||
--module-path /usr/local/openjdk-11/jmods \ | ||
RUN apk --no-cache add openjdk11=11.0.4_p4-r1 \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& /usr/lib/jvm/java-11-openjdk/bin/jlink \ | ||
--module-path /usr/lib/jvm/java-11-openjdk/jmods \ | ||
--compress=2 \ | ||
--add-modules java.base,java.scripting.java.logging,java.xml,jdk.zipfs,jdk.scripting.nashorn,jdk.scripting.nashorn.shell \ | ||
--add-modules java.base,java.scripting,java.logging,java.xml,jdk.zipfs,jdk.scripting.nashorn,jdk.scripting.nashorn.shell \ | ||
--no-header-files \ | ||
--no-man-pages \ | ||
--output /usr/src/mymaven/openjdk-11-minimal | ||
--output /opt/openjdk-11-minimal | ||
|
||
# building pochi | ||
FROM maven:3.6.3-jdk-11 AS maven | ||
|
||
ARG pochi_version="1.0.0" | ||
|
||
RUN git clone https://github.com/tamada/pochi.git /usr/src/mymaven/pochi \ | ||
&& cd /usr/src/mymaven/pochi \ | ||
&& git checkout -b v${pochi_version} refs/tags/v${pochi_version} \ | ||
&& mvn package \ | ||
&& unzip distribution/target/pochi-${pochi_version}-dist.zip -d /usr/src/mymaven | ||
|
||
# building distributed docker image. | ||
FROM alpine:3.10.1 | ||
|
||
## Is ARG binded to FROM? | ||
ARG pochi_version="1.0.0" | ||
|
||
LABEL maintainer="Haruaki Tamada" \ | ||
pochi-version="1.0.0" \ | ||
pochi-version="${pochi_version}" \ | ||
description="Java birthmarking toolkit." | ||
|
||
COPY --from=maven /usr/src/mymaven/openjdk-11-minimal /opt/openjdk-11-minimal | ||
COPY --from=maven /usr/src/mymaven/pochi-1.0.0 /home/pochi | ||
COPY --from=base /opt/openjdk-11-minimal /opt/openjdk-11-minimal | ||
COPY --from=maven /usr/src/mymaven/pochi-${pochi_version} /opt/pochi-${pochi_version} | ||
|
||
RUN adduser -D pochi \ | ||
&& chmod 755 /home/pochi/bin/pochi | ||
&& chmod 755 /opt/pochi-${pochi_version}/bin/pochi | ||
|
||
ENV POCHI_HOME="/opt/pochi-${pochi_version}" | ||
ENV JAVA_HOME="/opt/openjdk-11-minimal" | ||
ENV PATH="$PATH:$JAVA_HOME/bin" | ||
ENV PATH="$PATH:$JAVA_HOME/bin:/opt/pochi-${pochi_version}/bin" | ||
ENV HOME="/home/pochi" | ||
|
||
WORKDIR /home/pochi | ||
USER pochi | ||
|
||
ENTRYPOINT [ "9rules.sh" ] | ||
ENTRYPOINT [ "pochi" ] |
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,19 @@ | ||
# Memorandum | ||
|
||
## version up | ||
|
||
update each `pom.xml`, and `bin/pochi` | ||
|
||
we can update to development (`X.Y.Z**-SNAPSHOT**`) version, run `versions:set`, and `versions:commit` goals of maven like the following. | ||
If we want to rollback after `versions:set`, we can revert with using `versions:revert` goal. | ||
|
||
```sh | ||
mvn versions:set -DnewVersion=1.1.0-SNAPSHOT | ||
mvn versions:commit | ||
``` | ||
|
||
## debugging docker | ||
|
||
```sh | ||
docker run -it --rm --entrypoint="/bin/ash" tamada/pochi:1.0.0 | ||
``` |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#! /bin/sh | ||
|
||
VERSION=1.0-SNAPSHOT | ||
POCHI_HOME=/home/pochi | ||
VERSION=1.0.0 | ||
if [ -z "$POCHI_HOME" ]; then | ||
POCHI_HOME=/usr/local/Cellar/pochi/${VERSION} | ||
fi | ||
|
||
java -jar $POCHI_HOME/lib/pochi-${VERSION}-all.jar $@ |
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
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
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
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
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
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
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
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
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