Skip to content
Open
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
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ DOCKERCOMPOSE_W_ENV = DEV_IMAGE_TAG=$(DEV_IMAGE_TAG) $(DOCKERCOMPOSE) -f compose
REBAR ?= rebar3
TEST_CONTAINER_NAME ?= testrunner

# Run development containers as the current host user.
# These values may be overridden through the environment or Makefile.env.
HOST_UID ?= $(shell id -u)
HOST_GID ?= $(shell id -g)

all: compile

.PHONY: dev-image clean-dev-image wc-shell test
Expand All @@ -36,7 +41,7 @@ ifneq ($(DEV_IMAGE_ID),)
rm .image.dev
endif

DOCKER_WC_OPTIONS := -v $(PWD):$(PWD) --workdir $(PWD)
DOCKER_WC_OPTIONS := --user $(HOST_UID):$(HOST_GID) --env HOME=/tmp -v $(PWD):$(PWD) --workdir $(PWD)
DOCKER_WC_EXTRA_OPTIONS ?= --rm
DOCKER_RUN = $(DOCKER) run -t $(DOCKER_WC_OPTIONS) $(DOCKER_WC_EXTRA_OPTIONS)

Expand All @@ -52,7 +57,7 @@ wc-%: dev-image

# TODO docker compose down doesn't work yet
wdeps-shell: dev-image
$(DOCKERCOMPOSE_RUN) $(TEST_CONTAINER_NAME) su; \
$(DOCKERCOMPOSE_RUN) $(TEST_CONTAINER_NAME) /bin/bash; \
$(DOCKERCOMPOSE_W_ENV) down

# Pass CT_CASE through to container env
Expand Down
Loading