FROM openjdk:8-jre-alpine

VOLUME /tmp

ADD target/ydl-admin-1.0-SNAPSHOT.jar ydl-admin.jar

RUN sh -c 'touch /ydl-admin.jar'

ENV JAVA_OPTS=""
ENV TZ=Asia/Shanghai
ENV SKYWALKING_OPTS=""

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add --no-cache tzdata bash ttf-dejavu fontconfig && fc-cache --force
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &&  echo $TZ > /etc/timezone

ENTRYPOINT [ "sh", "-c", "java $SKYWALKING_OPTS -jar $JAVA_OPTS -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom /ydl-admin.jar" ]