FROM openjdk:8u191-jdk-alpine3.9 MAINTAINER Tony RUN echo 'http://mirrors.aliyun.com/alpine/latest-stable/main' > /etc/apk/repositories && echo 'http://mirrors.aliyun.com/alpine/latest-stable/community' >>/etc/apk/repositories && apk update && apk add tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone RUN apk add --update curl && apk add bash && apk add curl && apk --no-cache add tini # Install ssh RUN apk add --no-cache openssh-server && apk add --no-cache openssh-client && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config && ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key && ssh-keygen -t ecdsa -P "" -f /etc/ssh/ssh_host_ecdsa_key && ssh-keygen -t ed25519 -P "" -f /etc/ssh/ssh_host_ed25519_key && echo "root:root" | chpasswd # Install language pack COPY ./sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub COPY ./glibc-2.25-r0.apk /glibc-2.25-r0.apk RUN apk add glibc-2.25-r0.apk && rm /glibc-2.25-r0.apk COPY ./glibc-bin-2.25-r0.apk /glibc-bin-2.25-r0.apk RUN apk add glibc-bin-2.25-r0.apk && rm /glibc-bin-2.25-r0.apk COPY ./glibc-i18n-2.25-r0.apk /glibc-i18n-2.25-r0.apk RUN apk add glibc-i18n-2.25-r0.apk && rm /glibc-i18n-2.25-r0.apk # Note that locale -a is not available in alpine linux, use `/usr/glibc-compat/bin/locale -a` instead COPY ./locale.md /locale.md RUN cat locale.md | xargs -i /usr/glibc-compat/bin/localedef -i {} -f UTF-8 {}.UTF-8 # Set the lang ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 # Set JAVA Home RUN echo "export PATH=$PATH:/usr/lib/jvm/java-1.8-openjdk/bin" >> /etc/profile && source /etc/profile # Expose 22 port EXPOSE 22 # Retart ssh CMD [ "/usr/sbin/sshd"]