Fix building in Docker for some enviroments (#834)

* Fix building in Docker for some enviroments

* debug hanging test
This commit is contained in:
Igor Mandrigin 2020-07-30 17:37:46 +02:00 committed by GitHub
parent f7b9846740
commit 7eecbc5d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 9 deletions

View File

@ -8,13 +8,13 @@ COPY go.mod go.sum /app/
RUN cd /app && go mod download RUN cd /app && go mod download
ADD . /app ADD . /app
RUN cd /app && make geth RUN cd /app && make tg
# Pull Geth into a second stage deploy alpine container # Pull Geth into a second stage deploy alpine container
FROM alpine:latest FROM alpine:latest
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates
COPY --from=builder /app/build/bin/geth /usr/local/bin/ COPY --from=builder /app/build/bin/tg /usr/local/bin/
EXPOSE 8545 8546 8547 30303 30303/udp EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["geth"] ENTRYPOINT ["tg"]

View File

@ -23,6 +23,11 @@ geth:
@echo "Done building." @echo "Done building."
@echo "Run \"$(GOBIN)/tg\" to launch turbo-geth." @echo "Run \"$(GOBIN)/tg\" to launch turbo-geth."
tg:
$(GORUN) build/ci.go install ./cmd/geth
@echo "Done building."
@echo "Run \"$(GOBIN)/tg\" to launch turbo-geth."
hack: hack:
$(GORUN) build/ci.go install ./cmd/hack $(GORUN) build/ci.go install ./cmd/hack
@echo "Done building." @echo "Done building."

View File

@ -341,6 +341,7 @@ func doTest(cmdline []string) {
// and some tests run into timeouts under load. // and some tests run into timeouts under load.
gotest := goTool("test", buildFlags(env)...) gotest := goTool("test", buildFlags(env)...)
gotest.Args = append(gotest.Args, "-p", "1") gotest.Args = append(gotest.Args, "-p", "1")
*verbose = true
if *coverage { if *coverage {
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover") gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
} }

View File

@ -278,24 +278,24 @@ func prepare(ctx *cli.Context) {
// If we're running a known preset, log it for convenience. // If we're running a known preset, log it for convenience.
switch { switch {
case ctx.GlobalIsSet(utils.LegacyTestnetFlag.Name): case ctx.GlobalIsSet(utils.LegacyTestnetFlag.Name):
log.Info("Starting Geth on Ropsten testnet...") log.Info("Starting Turbo-Geth on Ropsten testnet...")
log.Warn("The --testnet flag is ambiguous! Please specify one of --goerli, --rinkeby, or --ropsten.") log.Warn("The --testnet flag is ambiguous! Please specify one of --goerli, --rinkeby, or --ropsten.")
log.Warn("The generic --testnet flag is deprecated and will be removed in the future!") log.Warn("The generic --testnet flag is deprecated and will be removed in the future!")
case ctx.GlobalIsSet(utils.RopstenFlag.Name): case ctx.GlobalIsSet(utils.RopstenFlag.Name):
log.Info("Starting Geth on Ropsten testnet...") log.Info("Starting Turbo-Geth on Ropsten testnet...")
case ctx.GlobalIsSet(utils.RinkebyFlag.Name): case ctx.GlobalIsSet(utils.RinkebyFlag.Name):
log.Info("Starting Geth on Rinkeby testnet...") log.Info("Starting Turbo-Geth on Rinkeby testnet...")
case ctx.GlobalIsSet(utils.GoerliFlag.Name): case ctx.GlobalIsSet(utils.GoerliFlag.Name):
log.Info("Starting Geth on Görli testnet...") log.Info("Starting Turbo-Geth on Görli testnet...")
case ctx.GlobalIsSet(utils.DeveloperFlag.Name): case ctx.GlobalIsSet(utils.DeveloperFlag.Name):
log.Info("Starting Geth in ephemeral dev mode...") log.Info("Starting Turbo-Geth in ephemeral dev mode...")
case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name): case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name):
log.Info("Starting Geth on Ethereum mainnet...") log.Info("Starting Turbo-Geth on Ethereum mainnet...")
} }
// If we're a full node on mainnet without --cache specified, bump default cache allowance // If we're a full node on mainnet without --cache specified, bump default cache allowance
if !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) { if !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {