Share volumes between containers

Not sure what’s wrong here , but i can’t share volumes between containers, has anyone have a working example ?

I’m trying to share a volume ‘connectwebconfig’ for “connect web” service.

docker-compose.yml

version: '2’
services:
connectwebconfig:
image: xxxxxxx.dkr.ecr.us-east-1.amazonaws.com/connectwebconfig:v4
stdin_open: true
tty: true
command:
- /bin/sh
labels:
io.rancher.container.pull_image: always
io.rancher.scheduler.affinity:host_label: connectweb=true
db:
image: mysql
environment:
MYSQL_DATABASE: connect
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: admin
stdin_open: true
volumes:
- /data:/var/lib/mysql
tty: true
ports:
- 3306:3306/tcp
labels:
io.rancher.scheduler.affinity:host_label: connectweb=true
io.rancher.container.pull_image: always
connectweb:
image: xxxxxxx.dkr.ecr.us-east-1.amazonaws.com/connect-web:v17
stdin_open: true
tty: true
links:
- db:db
volumes_from:
- connectwebconfig
ports:
- 8081:80/tcp
labels:
io.rancher.scheduler.affinity:host_label: connectweb=true
io.rancher.container.pull_image: always

Dockerfile for my “connectwebconfig” service


FROM gliderlabs/alpine
WORKDIR /scout
COPY scout/app.config /scout
CMD “/bin/true”