title: How set up access to file on local filesystem for MySQL running on the docker container
body: <p>I install MySQL5.6 in the docker. </p>
  
  <p>I create docker-compose.ym and set properties for db</p>
  
  <pre><code>db:
    container_name: db_mysql
    image: mysql:5.6
    command: --secure-file-priv='/var/lib/'
    environment:
      MYSQL_DATABASE: devdb
      MYSQL_ROOT_PASSWORD: ""
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
    ports:
      - "3306:3306"
  
    volumes:
       - /home/marina/some-path:/var/lib/
  </code></pre>
  
  <p>but I can't use function</p>
  
  <p>SELECT LOAD_FILE('/home/marina/some-path/some-path-more/image.jpg').</p>
  
  <p>How can I configure volume to access my files from the docker?</p>
  
  <pre><code>Need mount my local file system to docker machine
  # Create the "default" machine, but then stop it.
  docker-machine create --driver virtualbox default
  docker-machine stop
  # Add a new shared folder through virtualbox
  VBoxManage sharedfolder add default --name "userhome" --hostpath 
  "/home/marina/"
  # Turn the machine back on, and mount the share
  docker-machine start
  docker-machine ssh default 'sudo mkdir --parents /home/marina'
  docker-machine ssh default 'sudo mount -t vboxsf userhome /home/marina'
  # Check it works
  docker-machine ssh default 'ls /home/marina'
  # Start it up
  docker-compose up
  </code></pre>
  
  <p>and change volume to:</p>
  
  <pre><code>volumes:
      - /home/marina/workprojectdir:/home/marina/workprojectdir
  </code></pre>
  
  <p>and set command:</p>
  
  <pre><code>command: --secure-file-priv=''
  </code></pre>