質問編集履歴
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,9 +20,43 @@
|
|
20
20
|
|
21
21
|
ENV PATH $PATH:$GOPATH/bin
|
22
22
|
|
23
|
+
|
24
|
+
|
25
|
+
RUN apk update && \
|
26
|
+
|
27
|
+
apk add --no-cache git && \
|
28
|
+
|
29
|
+
go get "github.com/go-sql-driver/mysql" && \
|
30
|
+
|
31
|
+
go get "github.com/beego/bee" && \
|
32
|
+
|
33
|
+
go get "github.com/astaxie/beego" && \
|
34
|
+
|
35
|
+
go get "github.com/astaxie/beego/session" && \
|
36
|
+
|
37
|
+
go get "golang.org/x/crypto/bcrypt" && \
|
38
|
+
|
39
|
+
go get "github.com/PuerkitoBio/goquery" && \
|
40
|
+
|
41
|
+
go get "github.com/microcosm-cc/bluemonday"
|
42
|
+
|
43
|
+
|
44
|
+
|
23
45
|
ADD . /go/src/app
|
24
46
|
|
25
47
|
WORKDIR /go/src/app
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
```DockerfileAfter
|
52
|
+
|
53
|
+
FROM golang:1.12.12-alpine3.9 AS build
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
ENV GOPATH $GOPATH:/go
|
58
|
+
|
59
|
+
ENV PATH $PATH:$GOPATH/bin
|
26
60
|
|
27
61
|
|
28
62
|
|
@@ -44,11 +78,21 @@
|
|
44
78
|
|
45
79
|
go get "github.com/microcosm-cc/bluemonday"
|
46
80
|
|
47
|
-
```
|
48
81
|
|
49
|
-
```DockerfileAfter
|
50
82
|
|
83
|
+
ADD . /go/src/app
|
84
|
+
|
85
|
+
WORKDIR /go/src/app
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
RUN go build -o app main.go
|
90
|
+
|
91
|
+
|
92
|
+
|
51
|
-
|
93
|
+
FROM alpine:3.9
|
94
|
+
|
95
|
+
COPY --from=build /go/src/app/ .
|
52
96
|
|
53
97
|
```
|
54
98
|
|
@@ -58,12 +102,26 @@
|
|
58
102
|
|
59
103
|
```エラー内容
|
60
104
|
|
61
|
-
|
105
|
+
実行
|
62
106
|
|
63
|
-
|
107
|
+
/app or bee run
|
64
108
|
|
109
|
+
エラーの出る行(main.go)
|
110
|
+
|
111
|
+
orm.RegisterDataBase("default", beego.AppConfig.String("driver"), beego.AppConfig.String("sqlconn")+"?charset=utf8mb4&loc=Asia%2FTokyo")
|
112
|
+
|
113
|
+
エラー
|
114
|
+
|
65
|
-
[ORM]
|
115
|
+
[ORM]2019/10/31 09:28:00 register db `default`, unknown time zone Asia/Tokyo
|
66
116
|
|
67
117
|
must have one register DataBase alias named `default`
|
68
118
|
|
69
119
|
```
|
120
|
+
|
121
|
+
追記
|
122
|
+
|
123
|
+
loc=Asia%2FTokyoを削除すると動作するのですが,タイムゾーンがUTCでDB保存されます.
|
124
|
+
|
125
|
+
なんとかなりますでしょうか?
|
126
|
+
|
127
|
+
よろしくお願いいたします.
|
3
加筆
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,7 +60,7 @@
|
|
60
60
|
|
61
61
|
編集中
|
62
62
|
|
63
|
-
エラーの出る行(main.go):orm.RegisterDataBase("default", "
|
63
|
+
エラーの出る行(main.go):orm.RegisterDataBase("default", beego.AppConfig.String("driver"), beego.AppConfig.String("sqlconn")+"?charset=utf8mb4&loc=Asia%2FTokyo")
|
64
64
|
|
65
65
|
[ORM](編集中)~ unknown timezone Asia/Tokyo
|
66
66
|
|
2
加筆
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
```DockerfileAfter
|
50
50
|
|
51
|
-
|
51
|
+
編集中
|
52
52
|
|
53
53
|
```
|
54
54
|
|
@@ -58,7 +58,11 @@
|
|
58
58
|
|
59
59
|
```エラー内容
|
60
60
|
|
61
|
-
|
61
|
+
編集中
|
62
|
+
|
63
|
+
エラーの出る行(main.go):orm.RegisterDataBase("default", "mysql", "○:○@tcp(○:3306)/○?charset=utf8mb4&Asia&Tokyo")
|
64
|
+
|
65
|
+
[ORM](編集中)~ unknown timezone Asia/Tokyo
|
62
66
|
|
63
67
|
must have one register DataBase alias named `default`
|
64
68
|
|
1
加筆
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,6 +60,6 @@
|
|
60
60
|
|
61
61
|
[ORM]
|
62
62
|
|
63
|
-
defalt
|
63
|
+
must have one register DataBase alias named `default`
|
64
64
|
|
65
65
|
```
|