From 7dd7765dda7286283641462dc2ae90641f74e9f8 Mon Sep 17 00:00:00 2001 From: kzw200015 Date: Wed, 8 Apr 2020 11:11:06 +0800 Subject: [PATCH 1/2] Add Docker Support --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe7848b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:alpine AS builder + +WORKDIR /root + +RUN apk update && apk add git \ + && git clone https://github.com/iyear/E5SubBot.git \ + && cd E5SubBot && go build + +FROM alpine:latest + +ENV TIME_ZONE=Asia/Shanghai + +RUN ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone + +WORKDIR /root + +COPY --from=builder /root/E5SubBot/main /root + +CMD [ "/root/main" ] \ No newline at end of file From 6e3b571755cd46891893207655eeac6da7cd11e6 Mon Sep 17 00:00:00 2001 From: kzw200015 Date: Wed, 8 Apr 2020 11:38:14 +0800 Subject: [PATCH 2/2] Fix timezone --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fe7848b..05cd476 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,8 @@ FROM alpine:latest ENV TIME_ZONE=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone +RUN apk update && apk add tzdata \ + && ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone WORKDIR /root