From 4dc644ea123b503116e435907d5eb06b6b508741 Mon Sep 17 00:00:00 2001 From: osamamagdy Date: Thu, 9 May 2024 14:44:57 +0200 Subject: [PATCH] fix: try different mount Signed-off-by: osamamagdy --- .github/workflows/test.yml | 7 ++----- utils/docker/Makefile | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ee947e85..e99bce2e4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,8 +34,6 @@ jobs: with: go-version-file: 'go.mod' - - run: go mod download - - uses: dorny/paths-filter@v3 id: filter with: @@ -62,10 +60,9 @@ jobs: env: DOCKER_DEV_CI_MODE: 1 DOCKER_QUIET_BUILD: 1 - run: | - DOCKER_DEV_RUN_OPTS="-v ~/go/pkg/mod/:/project/pkg/mod/" + run: | DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \ - make -C utils/docker run-dev DOCKER_DEV_OPTIONAL_CMD='env IS_CI_RUNNING=true \ + make -C utils/docker run-dev PACKAGE_MOUNT='-v ~/go/pkg/mod/:/project/pkg/mod/' DOCKER_DEV_OPTIONAL_CMD='env IS_CI_RUNNING=true \ make all' # # continue only if we push to main and rebuild docker images diff --git a/utils/docker/Makefile b/utils/docker/Makefile index fa44db6b7..fb54ab555 100644 --- a/utils/docker/Makefile +++ b/utils/docker/Makefile @@ -78,11 +78,15 @@ endif # allows to override with `buildx build` DOCKER_BUILD_CMD ?= build +# allows docker to look for packages mounted on the host +PACKAGE_MOUNT ?= # 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) # - 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