Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b64032282b | |||
| e9ec4a23dd |
10
Dockerfile
10
Dockerfile
@ -1,13 +1,17 @@
|
|||||||
FROM golang:1.19-alpine as builder
|
FROM golang:1.19-alpine as builder
|
||||||
|
|
||||||
RUN apk --update --no-cache add make git g++ linux-headers
|
RUN apk --update --no-cache add gcc libc-dev
|
||||||
# DEBUG
|
# DEBUG
|
||||||
RUN apk add busybox-extras
|
RUN apk add busybox-extras
|
||||||
|
|
||||||
# Get and build tx-spammer
|
# Get and build tx-spammer
|
||||||
ADD . /go/src/github.com/cerc-io/tx-spammer
|
|
||||||
WORKDIR /go/src/github.com/cerc-io/tx-spammer
|
WORKDIR /go/src/github.com/cerc-io/tx-spammer
|
||||||
RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o tx-spammer .
|
|
||||||
|
ENV GO111MODULE=on
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o tx-spammer .
|
||||||
|
|
||||||
# app container
|
# app container
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|||||||
@ -45,7 +45,7 @@ func Execute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initFuncs(cmd *cobra.Command, args []string) {
|
func initFuncs(cmd *cobra.Command, args []string) {
|
||||||
logfile := viper.GetString("logfile")
|
logfile := viper.GetString("log.file")
|
||||||
if logfile != "" {
|
if logfile != "" {
|
||||||
file, err := os.OpenFile(logfile,
|
file, err := os.OpenFile(logfile,
|
||||||
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
||||||
@ -65,7 +65,7 @@ func initFuncs(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func logLevel() error {
|
func logLevel() error {
|
||||||
viper.BindEnv("log.level", "LOGRUS_LEVEL")
|
viper.BindEnv("log.level", "LOG_LEVEL")
|
||||||
lvl, err := log.ParseLevel(viper.GetString("log.level"))
|
lvl, err := log.ParseLevel(viper.GetString("log.level"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user