dockerfile
FROM alpine
ENV LANG='zh_CN.UTF-8'
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& apk update \
&& apk --no-cache add openjdk8 curl busybox tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo Asia/Shanghai > /etc/timezone \
&& apk del tzdata \
&& rm -rf /tmp/* /var/cache/apk/*
build
$ docker build -t java8:alpine -f java.dockerfile .
result
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
java8 alpine 4d98855c53a9 2 hours ago 107MB