From e3e4f24103ec04970306ec7ab8d349c131d1aa4a Mon Sep 17 00:00:00 2001 From: osamamagdy Date: Thu, 16 May 2024 18:08:03 +0200 Subject: [PATCH] Refinements Signed-off-by: osamamagdy --- .github/workflows/test.yml | 2 ++ config.mk | 3 +++ utils/docker/Makefile | 11 +++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 688482efc..ced1276c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,9 +8,11 @@ on: push: paths-ignore: - '**.md' + - '.github/workflows/**' pull_request: paths-ignore: - '**.md' + - '.github/workflows/**' env: DOCKER_REGISTRY: 'ghcr.io' PUSH_TO_MAIN: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} diff --git a/config.mk b/config.mk index c3befd6c3..bb2c619d9 100644 --- a/config.mk +++ b/config.mk @@ -29,6 +29,9 @@ DOCKER_CMD := docker # - DOCKER_BASE_RT_IMAGE_APT_ADD_PKGS (for all infrastructure containers) # - DOCKER_BASE_DEV_IMAGE_APT_ADD_PKGS (for all images which build fabric/fpc code) # - DOCKER_DEV_IMAGE_APT_ADD_PKGS (for dev image) +# - You can mount your local go mod cache directory +# to that of the docker image which allows caching of the dependencies and faster builds +# - GOMODCACHE_PATH (the path of your local go packages usually known by `go env GOMODCACHE`) # SGX related settings diff --git a/utils/docker/Makefile b/utils/docker/Makefile index fb54ab555..847a0730a 100644 --- a/utils/docker/Makefile +++ b/utils/docker/Makefile @@ -78,15 +78,18 @@ endif # allows to override with `buildx build` DOCKER_BUILD_CMD ?= build -# allows docker to look for packages mounted on the host -PACKAGE_MOUNT ?= +# allows to mount host gomodcache into the container +GOMODCACHE_PATH ?= +DOCKER_GOMODCACHE=/project/pkg/mod # Docker run options # ------------------ DOCKER_DEV_RUN_OPTS ?= DOCKER_DEV_RUN_OPTS += --rm -# - mount local packages from the host to activate caching -DOCKER_DEV_RUN_OPTS += $(PACKAGE_MOUNT) +# - mount local gomodcache from the host +ifneq ($(GOMODCACHE_PATH),) + DOCKER_DEV_RUN_OPTS += -v "$(GOMODCACHE_PATH)":"$(DOCKER_GOMODCACHE)" +endif # - import docker daemon socket (so dev container can run docker) DOCKER_DEV_RUN_OPTS += -v "$(DOCKER_DAEMON_SOCKET)":"$(DOCKER_SOCKET)" # - mount local fpc repo into the dev container so development inside container is