Dockerfile 780 B

12345678910111213141516171819202122
  1. FROM alpine
  2. RUN echo -e https://mirrors.ustc.edu.cn/alpine/v3.15/main > /etc/apk/repositories \
  3. && cat /etc/apk/repositories \
  4. # 设置时区为上海
  5. && apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  6. && echo "Asia/Shanghai" > /etc/timezone \
  7. && apk del tzdata \
  8. # 解决apline 运行编译后的执行文件 not found错误
  9. # 由于alpine镜像使用的是musl libc而不是gnu libc,/lib64/ 是不存在的。但他们是兼容的,可以创建个软连接
  10. && mkdir /lib64 \
  11. && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 \
  12. && mkdir -p /root/oilseal-exam
  13. WORKDIR /root/oilseal-exam
  14. ADD ./file ./file
  15. ADD ./oilseal-exam ./
  16. ADD ./config-linux.yaml ./
  17. EXPOSE 3001
  18. ENTRYPOINT ["./oilseal-exam"]