0

So, I want to use kompose up on my docker-compose.yml which looks like this:

version: '3.6'

services:
  db:
    image: mysql:latest
    restart: always
    env_file: 
      - ./env/env_vars.env
    volumes:
      - ./db_data:/docker-entrypoint-initdb.d

But every time I do this, it returns

WARN Volume mount on the host "/home/test/Documents/test_pj/db_data" isn't supported - ignoring path on the host 

What can I do to this?

jkeeraa
  • 129
  • 2
  • 9
  • You need to move that database setup script into a Kubernetes ConfigMap. Kompose can't do this on its own. – David Maze Aug 31 '20 at 10:35
  • And how do I do this? @DavidMaze – jkeeraa Aug 31 '20 at 11:10
  • [The last time I researched this](https://stackoverflow.com/a/62116048/10008173) I recommended using `kompose convert` to generate YAML, checking it in, and adding the ConfigMap details. The Kubernetes documentation describes configuration to [Configure a Pod to Use a ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/). – David Maze Aug 31 '20 at 11:24

0 Answers0