直接在dockerfile文件中编写

[root@k8s-publish k8sjava]# cat Dockerfile
FROM openjdk:8-jdk-alpine
MAINTAINER ph
COPY server /server
RUN mkdir -p /java/log/ \
    && touch /java/log/java.log \
    &&  apk add --no-cache tzdata \
    &&  cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    &&  echo 'Asia/Shanghai' >/etc/timezone

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐