I have a MySQL instance hosted in Google Cloud SQL, and I have a container which uses this database, I tried to initialize the database schema from the docker file using the following command:
FROM anapsix/alpine-java
ADD ./mysql/init.sql /docker-entrypoint-initdb.d
init.sql
SET sql_mode = '';
CREATE DATABASE IF NOT EXISTS `locations_schema`;
USE `locations_schema`;
CREATE TABLE `locations` (
`id` int(11) NOT NULL,
`value` varchar(255) NOT NULL,
`label` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
But unfortunately this is not working, is there any way I can achieve the init of a DB?