From 21d0326bcb6f0870adc5c71051263e222ad0e657 Mon Sep 17 00:00:00 2001 From: Chris Gresty Date: Mon, 17 Feb 2020 15:45:32 +0000 Subject: [PATCH 1/4] Prepare for publishing Docker image --- docker/styx-image/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/styx-image/Dockerfile b/docker/styx-image/Dockerfile index 4c99118538..c74f904b23 100644 --- a/docker/styx-image/Dockerfile +++ b/docker/styx-image/Dockerfile @@ -1,6 +1,11 @@ ARG TAG=11-jdk FROM openjdk:${TAG} +RUN addgroup styx && useradd -d /home/styx -g styx -s /bin/bash styx + +# Remove overriding ulimits +RUN rm -f /etc/security/limits.d/* + ARG STYX_VERSION="" ARG STYX_IMAGE=https://github.com/HotelsDotCom/styx/releases/download/${STYX_VERSION}/${STYX_VERSION}-linux-x86_64.zip @@ -21,8 +26,13 @@ ADD origins.yml /styx/default-config/origins.yml RUN unzip styx.zip \ && rm styx.zip +RUN mkdir -p ${STYX_LOG_OUTPUT} +RUN chown styx:styx ${STYX_LOG_OUTPUT} + EXPOSE 8080 8443 9000 +USER styx + CMD ["/styx/default-config/default.yml"] ENTRYPOINT ["styx/bin/startup"] From d0ea1d78dbc5b20319fa77f7c78d41765571ade4 Mon Sep 17 00:00:00 2001 From: Chris Gresty Date: Tue, 18 Feb 2020 15:35:03 +0000 Subject: [PATCH 2/4] Expand styx.zip into root directory --- docker/styx-image/Dockerfile | 12 ++++++------ docker/styx-image/styx-env.sh | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/styx-image/Dockerfile b/docker/styx-image/Dockerfile index c74f904b23..a64670faa2 100644 --- a/docker/styx-image/Dockerfile +++ b/docker/styx-image/Dockerfile @@ -12,20 +12,20 @@ ARG STYX_IMAGE=https://github.com/HotelsDotCom/styx/releases/download/${STYX_VER ENV APP_HOME=/styx ENV STYX_CONFIG=/styx/default-config/default.yml -ENV STYX_LOG_CONFIG=/styx/styx/conf/logback.xml +ENV STYX_LOG_CONFIG=/styx/conf/logback.xml ENV STYX_ENV_FILE=/styx/default-config/styx-env.sh ENV STYX_LOG_OUTPUT=/styx/logs/ +ADD ${STYX_IMAGE} /styx.zip +RUN unzip /styx.zip \ + && rm /styx.zip + WORKDIR ${APP_HOME} -ADD ${STYX_IMAGE} ${APP_HOME}/styx.zip ADD default-docker.yml /styx/default-config/default.yml ADD styx-env.sh /styx/default-config/styx-env.sh ADD origins.yml /styx/default-config/origins.yml -RUN unzip styx.zip \ - && rm styx.zip - RUN mkdir -p ${STYX_LOG_OUTPUT} RUN chown styx:styx ${STYX_LOG_OUTPUT} @@ -35,4 +35,4 @@ USER styx CMD ["/styx/default-config/default.yml"] -ENTRYPOINT ["styx/bin/startup"] +ENTRYPOINT ["bin/startup"] diff --git a/docker/styx-image/styx-env.sh b/docker/styx-image/styx-env.sh index 94d31dbf37..742ba59838 100644 --- a/docker/styx-image/styx-env.sh +++ b/docker/styx-image/styx-env.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (C) 2013-2019 Expedia Inc. +# Copyright (C) 2013-2020 Expedia Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ JVM_DIRECT_MEMORY="${JVM_DIRECT_MEMORY:=-XX:MaxDirectMemorySize=512m}" JVM_HEAP_OPTS="${JVM_HEAP_OPTS:=-XX:+AlwaysPreTouch}" -JVM_GC_LOG="${JVM_GC_LOG:=-XX:+PrintGCDetails -Xloggc:/styx/logs/gc.log.$(/bin/date +%Y-%m-%d-%H%M%S)}" +JVM_GC_LOG="${JVM_GC_LOG:=-XX:+PrintGCDetails -Xloggc:${APP_HOME}/logs/gc.log.$(/bin/date +%Y-%m-%d-%H%M%S)}" JVM_HEAP_DUMP="${JVM_HEAP_DUMP:=-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/tmp}" # Set java VM type From 0fc81ff491e4a70ccc42715e2729591d76cdfa66 Mon Sep 17 00:00:00 2001 From: Chris Gresty Date: Wed, 19 Feb 2020 16:26:36 +0000 Subject: [PATCH 3/4] Move user/limits commands down in Dockerfile --- docker/styx-image/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/styx-image/Dockerfile b/docker/styx-image/Dockerfile index a64670faa2..bf5380a125 100644 --- a/docker/styx-image/Dockerfile +++ b/docker/styx-image/Dockerfile @@ -1,11 +1,6 @@ ARG TAG=11-jdk FROM openjdk:${TAG} -RUN addgroup styx && useradd -d /home/styx -g styx -s /bin/bash styx - -# Remove overriding ulimits -RUN rm -f /etc/security/limits.d/* - ARG STYX_VERSION="" ARG STYX_IMAGE=https://github.com/HotelsDotCom/styx/releases/download/${STYX_VERSION}/${STYX_VERSION}-linux-x86_64.zip @@ -16,6 +11,11 @@ ENV STYX_LOG_CONFIG=/styx/conf/logback.xml ENV STYX_ENV_FILE=/styx/default-config/styx-env.sh ENV STYX_LOG_OUTPUT=/styx/logs/ +RUN addgroup styx && useradd -d /home/styx -g styx -s /bin/bash styx + +# Remove overriding ulimits +RUN rm -f /etc/security/limits.d/* + ADD ${STYX_IMAGE} /styx.zip RUN unzip /styx.zip \ && rm /styx.zip From ffce0267b198752f826d615079e412b65c45efb6 Mon Sep 17 00:00:00 2001 From: Chris Gresty Date: Wed, 19 Feb 2020 16:44:04 +0000 Subject: [PATCH 4/4] Trigger rebuild