31 lines
821 B
YAML
31 lines
821 B
YAML
name: POC Docker volume mount
|
|
on:
|
|
push:
|
|
branches:
|
|
- plan/0003-alkaa-käyttämään-itseään-commit-raportti
|
|
|
|
jobs:
|
|
test-volume:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Create shared volume
|
|
run: docker volume create poc-shared
|
|
|
|
- name: Container 1 — write file
|
|
run: |
|
|
docker run --rm -v poc-shared:/data alpine sh -c '
|
|
echo "Hello from container 1! Timestamp: $(date -u)" > /data/hello.txt
|
|
echo "Container 1 wrote file. Content:"
|
|
cat /data/hello.txt
|
|
'
|
|
|
|
- name: Container 2 — read file
|
|
run: |
|
|
docker run --rm -v poc-shared:/data alpine sh -c '
|
|
echo "Container 2 reads:"
|
|
cat /data/hello.txt
|
|
'
|
|
|
|
- name: Cleanup
|
|
run: docker volume rm poc-shared
|