dockerfile

FROM openjdk:8u191-jdk-alpine3.9 
MAINTAINER ggggg

RUN  echo 'http://mirrors.aliyun.com/alpine/v3.9/main' > /etc/apk/repositories 
RUN  echo 'http://mirrors.aliyun.com/alpine/v3.9/community' >>/etc/apk/repositories 
RUN  apk update --allow-untrusted 
RUN  apk add tzdata --allow-untrusted
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
RUN apk add --update curl --allow-untrusted
RUN apk add bash --allow-untrusted
RUN apk add curl --allow-untrusted
RUN apk --no-cache add tini --allow-untrusted

RUN apk add --no-cache openssh-server --allow-untrusted
RUN apk add --no-cache openssh-client --allow-untrusted
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
RUN ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t ecdsa -P "" -f /etc/ssh/ssh_host_ecdsa_key
RUN ssh-keygen -t ed25519 -P "" -f /etc/ssh/ssh_host_ed25519_key
RUN echo "root:root" | chpasswd
COPY ./glibc/sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub

COPY ./glibc/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/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/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/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"]

 

posted @ 2023-03-10 16:47  滴滴滴  阅读(22)  评论(0编辑  收藏  举报