sclorg / mysql-container

MySQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
128 stars 201 forks source link

How to initialize mysql container when created on openshift 3.11? #270

Open imranrazakhan opened 4 years ago

imranrazakhan commented 4 years ago

I want to set initial data on MySQL of container. As per doc they recommend following way but its not working

apiVersion: extensions/v1beta1
kind: Pod
metadata:
  name: mysql
spec:
  containers:
  - name: mysql
    image: mysql        
    ports:
      - containerPort: 3306
    volumeMounts:
      - name: mysql-initdb
        mountPath: /docker-entrypoint-initdb.d
  volumes:
    - name: mysql-initdb
      configMap:
        name: mysql-initdb-config
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-initdb-config
data:
  initdb.sql: |
..... script here ....
IvanSivric commented 4 years ago

/docker-entrypoint-initdb.d works only with official mysql image. There is not such mechanism with redhat version...

phracek commented 4 months ago

@imranrazakhan Please see our Templates examples in the example directory.

Is this issue also reproducible in OpenShift 4 environment? If not, please close this issue.