-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
86 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ | |
*.out | ||
|
||
/vendor/** | ||
/.idea/** | ||
/.idea/** | ||
*.html | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"go.testFlags": ["-v"] | ||
"go.testFlags": ["-v"], | ||
"go.goroot": "/root/soft/go", | ||
"go.gopath": "/root/soft/gopath", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:alpine AS builder | ||
RUN apk add --no-cache ca-certificates \ | ||
make \ | ||
git | ||
COPY . /go-build | ||
RUN cd /go-build && \ | ||
export GO111MODULE=on && \ | ||
export GOPROXY=https://goproxy.io && \ | ||
go build -o 'golang-exe' path/to/main/ | ||
|
||
FROM alpine | ||
RUN apk add --no-cache tzdata | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs | ||
COPY --from=builder /go-build/golang-exe /usr/bin/golang-exe | ||
ENV TZ Asia/Shanghai | ||
CMD ["golang-exe"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package sysinit | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/bamzi/jobrunner" | ||
) | ||
|
||
func InitCron() { | ||
jobrunner.Start() | ||
// jobrunner.Schedule("@every 2s", PrintTime{}) | ||
|
||
} | ||
|
||
// 打印时间任务 | ||
type PrintTime struct { | ||
} | ||
|
||
func (p PrintTime) Run() { | ||
fmt.Println("time:", time.Now()) | ||
} | ||
|
||
// docker run -dit -p 8797:9090 -v /root/soft/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus |
This file was deleted.
Oops, something went wrong.