Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build: make db-tools to depend on git-submodules #4024

Merged
merged 5 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgc
WORKDIR /app
ADD . .

# expect that host run `git submodule update --init`
RUN make erigon rpcdaemon integration sentry txpool downloader hack db-tools
RUN make erigon rpcdaemon integration sentry txpool downloader hack observer db-tools

FROM docker.io/library/alpine:3.15

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ go-version:
exit 1 ;\
fi

docker:
docker: git-submodules
DOCKER_BUILDKIT=1 docker build -t erigon:latest --build-arg git_commit='${GIT_COMMIT}' --build-arg git_branch='${GIT_BRANCH}' --build-arg git_tag='${GIT_TAG}' .

xdg_data_home := ~/.local/share
Expand Down Expand Up @@ -74,7 +74,7 @@ $(COMMANDS): %: %.cmd

all: erigon $(COMMANDS)

db-tools:
db-tools: git-submodules
@echo "Building db-tools"

# hub.docker.com setup incorrect gitpath for git modules. Just remove it and re-init submodule.
Expand Down Expand Up @@ -137,6 +137,7 @@ escape:
cd $(path) && go test -gcflags "-m -m" -run none -bench=BenchmarkJumpdest* -benchmem -memprofile mem.out

git-submodules:
@[ -d ".git" ] || (echo "Not a git repository" && exit 1)
@echo "Updating git submodules"
@# Dockerhub using ./hooks/post-checkout to set submodules, so this line will fail on Dockerhub
@git submodule update --quiet --init --recursive --force || true