Sharing docker workspaces between stages

Jenkins setup: 2.426.3 (yes its old)
Java 11.0.22 (also old) on a container on rl8 linux

We have a MultiBranch Declarative pipeline using docker (actually, podman) containers. For one task, we need to build the product using one image, then run the tests using another image (different OS as the build OS doesn’t support the test tools), but the tests obviously should run in the same workspace where the built binaries are.

This seems to be what reuseNode is for, but it doesn’t seem to be working - the test stage is usually run on a different docker host

agent {label "podman"}
stages {
stage("build") {
agent { docker { image "image1" } }
steps { ... }
}
stage("test") {
agent { 
  docker { image "image2"
  reuseNode true }
}
steps{...}
}
}

What am I missing here? Are there alternatives I could use to share workspace between the stages?
I could possibly use stash/unstash but the list of stashed files might be large and somewhat dynamic.

As far as I understand it, you are correct that reuseNode true is intended to run the container on the same Jenkins node (host), but it does not guarantee the same workspace directory across different containers. Each docker block by default creates a new container, and unless you explicitly mount the workspace, the files from the build stage will not be available in the test stage.

Could we mount explicitly the workspace into both containers?

pipeline {
  agent { label 'podman' }
  stages {
    stage('build') {
      agent {
        docker {
          image 'image1'
          args "-v ${env.WORKSPACE}:${env.WORKSPACE}"
        }
      }
      steps {
        dir("${env.WORKSPACE}") {
          // build steps
        }
      }
    }
    stage('test') {
      agent {
        docker {
          image 'image2'
          reuseNode true
          args "-v ${env.WORKSPACE}:${env.WORKSPACE}"
        }
      }
      steps {
        dir("${env.WORKSPACE}") {
          // test steps
        }
      }
    }
  }
}