-
Notifications
You must be signed in to change notification settings - Fork 53
/
jobs-scheduler.Dockerfile
36 lines (24 loc) · 1.07 KB
/
jobs-scheduler.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM openjdk:23-ea-11-slim
ARG USER=openhouse
ARG USER_ID=1000
ARG GROUP_ID=1000
ENV APP_NAME=openhouse-spark-apps_2.12
ENV USER_HOME=/home/$USER
# Create an openhouse user as there's no reason to run as root user
RUN groupadd --force -g $GROUP_ID $USER && useradd -l -d $USER_HOME -m $USER -u $USER_ID -g $GROUP_ID
WORKDIR $USER_HOME
# IMAGE does not set the necessary paths by default.
ENV PATH=$PATH:/export/apps/jdk/JDK-1_8_0_172/bin/:$USER_HOME
ARG BUILD_DIR="build/$APP_NAME/libs"
ARG JAR_FILES=$BUILD_DIR/*-uber.jar
COPY $JAR_FILES ./
# Rename the JAR file.
RUN ls ./
RUN find ./ -name "*.jar" -exec mv {} $APP_NAME.jar \;
RUN ls $APP_NAME.jar
# Ensure that everything in $USER_HOME is owned by openhouse user
RUN chown -R openhouse:openhouse $USER_HOME
# Setup default path for Java
RUN mkdir -p /usr/java && ln -sfn /export/apps/jdk/JDK-1_8_0_172 /usr/java/default
USER $USER
ENTRYPOINT ["sh", "-c", "java -Xmx256M -Xms64M -XX:NativeMemoryTracking=summary -cp $APP_NAME.jar com.linkedin.openhouse.jobs.scheduler.JobsScheduler --tokenFile /var/config/openhouse.token $@"]