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 makefile misc improvements #63

Merged
merged 5 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,22 @@ You can also just invoke the container and work directly from its shell:
make -C ci/docker shell
```

If you prefer, you can build the container image locally by running:
Finally, if you prefer, you can build the container image locally by running:

```bash
make -C ci/docker build
```

In the case you want to use the locally built imaghe, or just not want to fetch
AfonsoSantos96 marked this conversation as resolved.
Show resolved Hide resolved
the latest available docker image, when invoking the Makefile you should tell it
you want to use the local image and not fetch it automatically. This is also
useful when you don't have a network connection or just want to skip that step
to speed up the command. For example:

```bash
make -C ci/docker DOCKER_PULL=n format-check
```

---

**NOTE**
Expand Down
6 changes: 5 additions & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ DOCKER?=$(shell which docker)
docker_repo:=baoproject/bao
docker_tag:=latest
docker_image:=$(docker_repo):$(docker_tag)
docker_run_cmd:=$(DOCKER) run --pull=always --rm -it -u bao -v \
DOCKER_PULL?=y
ifeq ($(DOCKER_PULL),y)
docker_pull_option:=--pull=always
endif
docker_run_cmd:=$(DOCKER) run $(docker_pull_option) --rm -it -u bao -v \
$(root_dir):$(root_dir) -w $(root_dir) $(docker_image)

override MAKEFLAGS:=$(addprefix -,$(MAKEFLAGS)) --no-print-directory
Expand Down