diff --git a/.github/workflows/erlang-checks.yml b/.github/workflows/erlang-checks.yml index 2e6caee..283f4d9 100644 --- a/.github/workflows/erlang-checks.yml +++ b/.github/workflows/erlang-checks.yml @@ -30,7 +30,7 @@ jobs: run: name: Run checks needs: setup - uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1 + uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v2 with: otp-version: ${{ needs.setup.outputs.otp-version }} rebar-version: ${{ needs.setup.outputs.rebar-version }} @@ -38,4 +38,4 @@ jobs: thrift-version: ${{ needs.setup.outputs.thrift-version }} run-ct-with-compose: true upload-coverage: false - cache-version: v4 + cache-version: v5 diff --git a/Dockerfile.dev b/Dockerfile.dev index 4c0b0f0..2ead6be 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -11,9 +11,16 @@ RUN wget -q -O- "https://github.com/valitydev/thrift/releases/download/${THRIFT_ RUN apt-get update && apt-get install -y cmake +# Setup user for matching permissions in mounted volumes +ARG USER_UID=1000 +ARG USER_GID=1000 +RUN groupadd -g ${USER_GID} dev && \ + useradd -m -s /bin/bash -u ${USER_UID} -g ${USER_GID} dev +USER dev + # Set env ENV CHARSET=UTF-8 ENV LANG=C.UTF-8 # Set runtime -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/Makefile b/Makefile index d16562f..1bb4348 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,12 @@ DOTENV := $(shell grep -v '^\#' .env) # Development images DEV_IMAGE_TAG = $(TEST_CONTAINER_NAME)-dev DEV_IMAGE_ID = $(file < .image.dev) +USER_UID:=$(shell id -u) +USER_GID:=$(shell id -g) DOCKER ?= docker DOCKERCOMPOSE ?= docker compose -DOCKERCOMPOSE_W_ENV = DEV_IMAGE_TAG=$(DEV_IMAGE_TAG) $(DOCKERCOMPOSE) -f compose.yaml -f compose.tracing.yaml +DOCKERCOMPOSE_W_ENV = USER_UID=$(USER_UID) USER_GID=$(USER_GID) DEV_IMAGE_TAG=$(DEV_IMAGE_TAG) $(DOCKERCOMPOSE) -f compose.yaml -f compose.tracing.yaml REBAR ?= rebar3 TEST_CONTAINER_NAME ?= testrunner @@ -51,7 +53,7 @@ wc-%: dev-image $(DOCKER_RUN) $(DEV_IMAGE_TAG) make $* wdeps-shell: dev-image - $(DOCKERCOMPOSE_RUN) $(TEST_CONTAINER_NAME) su; \ + $(DOCKERCOMPOSE_RUN) $(TEST_CONTAINER_NAME) bash; \ $(DOCKERCOMPOSE_W_ENV) down wdeps-%: dev-image diff --git a/compose.yaml b/compose.yaml index e573ecd..505a12d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -14,6 +14,9 @@ services: args: OTP_VERSION: $OTP_VERSION THRIFT_VERSION: $THRIFT_VERSION + USER_UID: $USER_UID + USER_GID: $USER_GID + user: "${USER_UID:-1000}:${USER_GID:-1000}" volumes: - .:$PWD hostname: dmt.default