Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Unified dockerfiles, finished post_build

Christian Bauerfe63442822fb
diff --git a/Dockerfile b/Dockerfile
index 486b13ccf..ad856a5b1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -29,15 +29,6 @@ RUN { \
RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
ENV JAVA_HOME /docker-java-home
-ENV JAVA_VERSION 8u181
-ENV JAVA_DEBIAN_VERSION 8u181-b13-2~deb9u1
-
-# see https://bugs.debian.org/775775
-# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
-# and https://packages.debian.org/stretch/ca-certificates-java
-# TODO This seems to be fixed now?
-#ENV CA_CERTIFICATES_JAVA_VERSION 20170929~deb9u1
-
RUN set -ex; \
\
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
@@ -47,7 +38,7 @@ RUN set -ex; \
\
apt-get update; \
apt-get install -y \
- openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
+ openjdk-8-jdk \
ca-certificates-java\
; \
rm -rf /var/lib/apt/lists/*; \
@@ -60,14 +51,14 @@ RUN set -ex; \
# ... and verify that it actually worked for one of the alternatives we care about
update-alternatives --query java | grep -q 'Status: manual'
-# see CA_CERTIFICATES_JAVA_VERSION notes above
+# Run postinst because it might not happen on install
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
# Add git commit label must be specified at build time using --build-arg GIT_COMMIT=dadadadadad
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT
-ENV JAVA_OPTS -Xmx1g
+############ EDITS ABOVE THIS LINE SHOULD BE DONE IN ALL DOCKERFILES! ################
# Install Docker client
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
@@ -79,4 +70,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
docker-ce docker-ce-cli containerd.io \
&& rm -rf /var/lib/apt/lists/*
-VOLUME src
\ No newline at end of file
+# Install Docker Compose executable
+RUN curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` \
+ -o /usr/local/bin/docker-compose && \
+ chmod +x /usr/local/bin/docker-compose
+
+# Install NodeJS 10 and Yarn
+RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
+ apt-get install -y nodejs && \
+ npm install --global yarn
+
+WORKDIR /openremote
\ No newline at end of file
diff --git a/hooks/post_build b/hooks/post_build
index 8de60d4c5..fceaad33f 100644
--- a/hooks/post_build
+++ b/hooks/post_build
@@ -1,10 +1,20 @@
#!/bin/bash
echo "===> Building OpenRemote source"
-docker run --privileged \
- -v $(pwd):/src \
+docker run -v $(pwd):/openremote \
+ $IMAGE_NAME \
+ /bin/sh -c "./gradlew --console plain clean installDist"
+
+echo "===> Building OpenRemote images"
+docker run \
+ -v $(pwd):/openremote \
-v /var/run/docker.sock:/var/run/docker.sock \
+ --env DATE_TAG=$CACHE_TAG \
$IMAGE_NAME \
- cd /src && ./gradlew clean build installDist
+ /bin/sh -c "docker-compose -f profile/deploy.yml build --build-arg GIT_COMMIT=$SOURCE_COMMIT"
-echo "===> Building OpenRemote images"
-docker-compose -p openremote build
\ No newline at end of file
+echo "===> Pushing OpenRemote images"
+docker push openremote/manager:$CACHE_TAG
+docker push openremote/keycloak:$CACHE_TAG
+docker push openremote/proxy:$CACHE_TAG
+docker push openremote/postgresql:$CACHE_TAG
+docker push openremote/tileserver-gl:$CACHE_TAG
diff --git a/keycloak/Dockerfile b/keycloak/Dockerfile
index 612928c4c..41a616179 100644
--- a/keycloak/Dockerfile
+++ b/keycloak/Dockerfile
@@ -1,8 +1,11 @@
FROM debian:stretch
MAINTAINER [email protected]
-# Install curl, wget, ca-certificates, procps
+# Install utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
+ apt-transport-https \
+ gnupg2 \
+ software-properties-common \
procps \
ca-certificates \
curl \
@@ -26,14 +29,6 @@ RUN { \
RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
ENV JAVA_HOME /docker-java-home
-ENV JAVA_VERSION 8u181
-ENV JAVA_DEBIAN_VERSION 8u181-b13-2~deb9u1
-
-# see https://bugs.debian.org/775775
-# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
-# and https://packages.debian.org/stretch/ca-certificates-java
-ENV CA_CERTIFICATES_JAVA_VERSION 20170929~deb9u1
-
RUN set -ex; \
\
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
@@ -43,8 +38,8 @@ RUN set -ex; \
\
apt-get update; \
apt-get install -y \
- openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
- ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
+ openjdk-8-jdk \
+ ca-certificates-java\
; \
rm -rf /var/lib/apt/lists/*; \
\
@@ -56,9 +51,15 @@ RUN set -ex; \
# ... and verify that it actually worked for one of the alternatives we care about
update-alternatives --query java | grep -q 'Status: manual'
-# see CA_CERTIFICATES_JAVA_VERSION notes above
+# Run postinst because it might not happen on install
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
+# Add git commit label must be specified at build time using --build-arg GIT_COMMIT=dadadadadad
+ARG GIT_COMMIT=unknown
+LABEL git-commit=$GIT_COMMIT
+
+############ EDITS ABOVE THIS LINE SHOULD BE DONE IN ALL DOCKERFILES! ################
+
# Install dependencies for JBoss AS
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
diff --git a/keycloak/dev.Dockerfile b/keycloak/dev.Dockerfile
index b6c7f3970..e696b7d02 100644
--- a/keycloak/dev.Dockerfile
+++ b/keycloak/dev.Dockerfile
@@ -1,8 +1,11 @@
FROM debian:stretch
MAINTAINER [email protected]
-# Install curl, wget, ca-certificates, procps
+# Install utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
+ apt-transport-https \
+ gnupg2 \
+ software-properties-common \
procps \
ca-certificates \
curl \
@@ -26,14 +29,6 @@ RUN { \
RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
ENV JAVA_HOME /docker-java-home
-ENV JAVA_VERSION 8u181
-ENV JAVA_DEBIAN_VERSION 8u181-b13-2~deb9u1
-
-# see https://bugs.debian.org/775775
-# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
-# and https://packages.debian.org/stretch/ca-certificates-java
-ENV CA_CERTIFICATES_JAVA_VERSION 20170929~deb9u1
-
RUN set -ex; \
\
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
@@ -43,8 +38,8 @@ RUN set -ex; \
\
apt-get update; \
apt-get install -y \
- openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
- ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
+ openjdk-8-jdk \
+ ca-certificates-java\
; \
rm -rf /var/lib/apt/lists/*; \
\
@@ -56,9 +51,15 @@ RUN set -ex; \
# ... and verify that it actually worked for one of the alternatives we care about
update-alternatives --query java | grep -q 'Status: manual'
-# see CA_CERTIFICATES_JAVA_VERSION notes above
+# Run postinst because it might not happen on install
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
+# Add git commit label must be specified at build time using --build-arg GIT_COMMIT=dadadadadad
+ARG GIT_COMMIT=unknown
+LABEL git-commit=$GIT_COMMIT
+
+############ EDITS ABOVE THIS LINE SHOULD BE DONE IN ALL DOCKERFILES! ################
+
# Install dependencies for JBoss AS
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
diff --git a/manager/Dockerfile b/manager/Dockerfile
index dad536cf1..3364ef334 100644
--- a/manager/Dockerfile
+++ b/manager/Dockerfile
@@ -1,8 +1,11 @@
FROM debian:stretch
MAINTAINER [email protected]
-# Install curl, wget, ca-certificates, procps
+# Install utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
+ apt-transport-https \
+ gnupg2 \
+ software-properties-common \
procps \
ca-certificates \
curl \
@@ -26,14 +29,6 @@ RUN { \
RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
ENV JAVA_HOME /docker-java-home
-ENV JAVA_VERSION 8u181
-ENV JAVA_DEBIAN_VERSION 8u181-b13-2~deb9u1
-
-# see https://bugs.debian.org/775775
-# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
-# and https://packages.debian.org/stretch/ca-certificates-java
-ENV CA_CERTIFICATES_JAVA_VERSION 20170929~deb9u1
-
RUN set -ex; \
\
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
@@ -43,8 +38,8 @@ RUN set -ex; \
\
apt-get update; \
apt-get install -y \
- openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
- ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
+ openjdk-8-jdk \
+ ca-certificates-java\
; \
rm -rf /var/lib/apt/lists/*; \
\
@@ -56,13 +51,15 @@ RUN set -ex; \
# ... and verify that it actually worked for one of the alternatives we care about
update-alternatives --query java | grep -q 'Status: manual'
-# see CA_CERTIFICATES_JAVA_VERSION notes above
+# Run postinst because it might not happen on install
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
# Add git commit label must be specified at build time using --build-arg GIT_COMMIT=dadadadadad
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT
+############ EDITS ABOVE THIS LINE SHOULD BE DONE IN ALL DOCKERFILES! ################
+
ENV JAVA_OPTS -Xmx1g
ENV APP_DOCROOT /deployment/manager/app
diff --git a/postgresql/Dockerfile b/postgresql/Dockerfile
index 17af94dad..0ab67b909 100644
--- a/postgresql/Dockerfile
+++ b/postgresql/Dockerfile
@@ -1,8 +1,11 @@
FROM debian:stretch
MAINTAINER [email protected]
-# Install curl, wget, ca-certificates, procps
+# Install utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
+ apt-transport-https \
+ gnupg2 \
+ software-properties-common \
procps \
ca-certificates \
curl \
diff --git a/proxy/Dockerfile b/proxy/Dockerfile
index 865c1ec53..778685f0a 100644
--- a/proxy/Dockerfile
+++ b/proxy/Dockerfile
@@ -1,8 +1,11 @@
FROM debian:stretch
MAINTAINER [email protected]
-# Install curl, wget, ca-certificates, procps
+# Install utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
+ apt-transport-https \
+ gnupg2 \
+ software-properties-common \
procps \
ca-certificates \
curl \