# Shared volumes in freestyle composition

**URL:** <https://community.codefresh.io/t/shared-volumes-in-freestyle-composition/156>\
**Category:** Pipeline Steps\
**Created:** [October 9, 2019, 7:21am UTC](https://community.codefresh.io/t/shared-volumes-in-freestyle-composition/156 "2019-10-09T07:21:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![rsung](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/rsung/32/244_2.png) [@rsung](https://community.codefresh.io/u/rsung)\
**Post date:** [April 20, 2020, 7:08pm UTC](https://community.codefresh.io/t/shared-volumes-in-freestyle-composition/156/12 "2020-04-20T19:08:53Z")

</div>

@Kostis I’m still having challenges with shared volume. I’m getting the following error even though I’m following the documentation. The build spec snippet I’m using is below. Please advise.

**Error Message:**  
[SYSTEM]  
Message Failed to prepare composition: Run tests  
Caused by Cannot start composition with warnings [“Volume mapping is not supported, try use:  
/docker-entrypoint-initdb.d/mysql\_init.sql”]  
Documentation Link [Composition · Codefresh | Docs](https://codefresh.io/docs/docs/codefresh-yaml/steps/composition/)  
Pipeline executed successfully

**Build Spec**

```
  test:
    title: "Run tests"
    stage: Test
    type: composition
    fail_fast: true
    composition:
      version: "3"
      services:
        # Cache
        exos-redis:
          image: redis:3.2.8
          container_name: "redis"
          expose:
            - "6379"
          healthcheck:
            test: ["CMD", "redis-cli", "-h", "localhost", "ping"]
            interval: 10s
            timeout: 10s
            retries: 5
        # DB
        members-mysql:
          image: mysql/mysql-server:8.0.15
          env_file: .env
          ports:
            - 3306
          environment:
            MYSQL_ROOT_PASSWORD:abc
          volumes:
            - '${{CF_VOLUME_NAME}}/members/etc/docker/mysql/mysql_init.sql:/docker-entrypoint-initdb.d/mysql_init.sql'
          healthcheck:
            test: ["CMD", "curl", "-f", "http://localhost:3306"]
            interval: 10s
            timeout: 10s
            retries: 5
          command: --default-authentication-plugin=mysql_native_password

    composition_candidates:
      app:
        image: ${{build_members_test_image}}
        command: infrastructure/codefresh/test/test.sh
        env_file:
          - infrastructure/codefresh/test/test.env

```

---

_[View the full topic](https://community.codefresh.io/t/shared-volumes-in-freestyle-composition/156)._
