Fixes for mysql container boot up fail issue

This commit is contained in:
herlesupreeth
2021-01-08 07:44:29 +01:00
parent 7f0ad0a519
commit 736e9f66b8
2 changed files with 9 additions and 5 deletions

View File

@@ -31,4 +31,8 @@ ENV DEBIAN_FRONTEND=noninteractive
ADD mysql_init.sh /mysql_init.sh
RUN chmod 755 /mysql_init.sh
# Install updates and dependencies
RUN apt-get update && \
apt-get -y install mysql-server ca-certificates
CMD /mysql_init.sh

View File

@@ -26,12 +26,12 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
apt-get update
apt-get install --reinstall ca-certificates
apt-get install -y mysql-server
sed -i "s/127.0.0.1/0.0.0.0/g" /etc/mysql/mysql.conf.d/mysqld.cnf
mkdir /var/run/mysqld
chown -R mysql:mysql /var/run/mysqld
cat > ~/.my.cnf <<EOF
[mysql]
user=root
password=ims
EOF
echo 'Waiting for MySQL to start.'
/etc/init.d/mysql restart