...
Wiki Markup |
---|
based on whether the JDK or only the JRE is installed \\
RUN \{ \ \\
echo '#!/bin/sh'; \ \\
echo 'set -e'; \ \\
echo; \ \\
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ \\
\} > /usr/local/bin/docker-java-home \ \\
&& chmod +x /usr/local/bin/docker-java-home \\
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk \\
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin \\
\\
ENV JAVA_VERSION 8u212 \\
ENV JAVA_ALPINE_VERSION 8.212.04-r0 \\
\\
RUN set -x \ \\
&& apk add --no-cache \ \\
openjdk8="$JAVA_ALPINE_VERSION" \ \\
&& \[ "$JAVA_HOME" = "$(docker-java-home)" \] \\
\\
#ASPIRE \\ |
Wiki Markup |
---|
seem to have to give full path otherwise when you try and run it cannot find the run.sh script \\
CMD \["sh","/aspire/run.sh"\]|
\\
*NOTE:* In the Dockerfile above, Aspire logs are stored locally within the container (which is ok when testing the container). However, should a K8s pod/container fail which contains the container, then any Aspire logs will be lost and possible causes for the pod/container failing will also be lost. The option would be to store any log files to persistent storage (K8s volume) which can then be accessed whether the pod/container is running or not. See [https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage|https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage] for more information.
+Run the container locally on your machine (to test)+
In order to test your Dockerfile works as expected, you can run a series of Docker commands as shown below: |
sudo docker build <path to folder containing Dockerfile> -t aspire |
docker build . -t aspire \ |
...
gcloud auth configure-docker |
docker tag aspire eu.gcr.io/<PROJECT_ID>/aspire:latest |
docker push eu.gcr.io/<PROJECT_ID>/aspire:latest |
steps: |
Wiki Markup |
---|
name: "gcr.io/cloud-builders/docker" \\
args: \\
\[ \\
"build", \\
"--build-arg", \\
"ASPIRE_MAVEN_USERNAME", \\
"--build-arg", \\
"ASPIRE_MAVEN_PASSWORD", \\
"-t", \\
"gcr.io/<PROJECT_ID>/bitbucket.org/aspire", \\
".", \\
\] \\
secretEnv: \["ASPIRE_MAVEN_USERNAME", "ASPIRE_MAVEN_PASSWORD"\] \\
\\ |
Wiki Markup |
---|
name: "gcr.io/cloud-builders/docker" \\
args: \["push", "gcr.io/<PROJECT_ID>/bitbucket.org/blahblah/aspire"\] \\
\\
secrets: \\ |