The files aren’t shared.
---
kind: pipeline
type: docker
name: Tests
platform:
arch: amd64
os: linux
steps:
- name: tests
image: docker:dind
volumes:
- name: docker_sock
path: /var/run/docker.sock
- name: cache
path: /cache
commands:
- pwd
- touch /cache/hello-world.txt
- ls -lia /cache/*.txt
- echo "=== begin of inner container ==="
- docker run -v /cache:/cache alpine sh -c "ls -lia /cache/*.txt"
- docker run -v /cache:/cache alpine sh -c "touch /cache/bye-world.txt"
- docker run -v /cache:/cache alpine sh -c "ls -lia /cache/*.txt"
- echo "=== end of inner container ==="
- ls -lia /cache/*.txt
depends_on:
- clone
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock
- name: cache
host:
path: /opt/xablau1
Output:
+ pwd
/drone/src
+ touch /cache/hello-world.txt
+ ls -lia /cache/*.txt
580364 -rw-r--r-- 1 root root 0 Sep 28 18:12 /cache/hello-world.txt
+ echo "=== begin of inner container ==="
=== begin of inner container ===
+ docker run -v /cache:/cache alpine sh -c "ls -lia /cache/*.txt"
2816006 -rw-r--r-- 1 root root 0 Sep 28 18:12 /cache/bye-world.txt
+ docker run -v /cache:/cache alpine sh -c "touch /cache/bye-world.txt"
+ docker run -v /cache:/cache alpine sh -c "ls -lia /cache/*.txt"
2816006 -rw-r--r-- 1 root root 0 Sep 28 18:12 /cache/bye-world.txt
+ echo "=== end of inner container ==="
=== end of inner container ===
+ ls -lia /cache/*.txt
580364 -rw-r--r-- 1 root root 0 Sep 28 18:12 /cache/hello-world.txt
Does anybody have an idea?