zoukankan      html  css  js  c++  java
  • Docker容器与Linux主机环境获取时间不一致

    最近通过Docker部署了.Net Core项目,发现创建时间和修改时间与实际时间慢8小时,默认不是东八区了,通过同步时间来解决。

    FROM microsoft/dotnet:2.2-aspnetcore-runtime
    FROM mcr.microsoft.com/dotnet/core/sdk:2.2
    WORKDIR /app
    COPY . /app
    WORKDIR /app
    ENV ASPNETCORE_URLS http://+:5002
    ENV ASPNETCORE_ENVIRONMENT=Production
    EXPOSE 5002
    #时区设置
    RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
    RUN echo 'Asia/Shanghai' >/etc/timezone
    #ENV certPassword 123456
    #RUN openssl genrsa -des3 -passout pass:${certPassword} -out server.key 2048
    #RUN openssl rsa -passin pass:${certPassword} -in server.key -out server.key
    #RUN openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=wuzhd'
    #RUN openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
    #RUN openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt -certfile server.crt -passout pass:${certPassword}
    CMD  ["dotnet", "Api.dll"]

    重新build镜像即可。

  • 相关阅读:
    移动及pc端实现签名功能
    中文字符长度与英文字符长度的计算
    IE8部分兼容问题及解决方法
    如何本地搭建手机可访问的web网页
    MYSQL索引的作用和创建
    HTTP协议
    data.json
    axios
    axios基本用法
    Component 初识组件
  • 原文地址:https://www.cnblogs.com/ZhengHengWU/p/12883627.html
Copyright © 2011-2022 走看看