gitlabRunner:mysqld:无法读取"/etc/mysql/conf.d/"的目录 [英] gitlab runner: mysqld: Can't read dir of '/etc/mysql/conf.d/'

查看:84
本文介绍了gitlabRunner:mysqld:无法读取"/etc/mysql/conf.d/"的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在docker中使用gitlab赛跑者.

I use gitlab runners in docker.

它使用我们自己的php映像和mysql:5.7映像.它以前曾起作用,但现在在启动CI作业时我们可以看到此错误:

It uses our own php image and mysql:5.7 image. It worked before, but now we can see this error when CI job is started:

Running with gitlab-runner 10.4.0 (857480b6)
  on gitlab-runner-2 (00929f5e)
Using Docker executor with image registry.blahblah.work/infra/docker-base/php ...
Starting service mysql:5.7 ...
Pulling docker image mysql:5.7 ...
Using docker image mysql:5.7 ID=sha256:f008d8ff927dc527c5a57251b45cead7c9259c16a6a93c144f397eaafc103d36 for mysql service...
Waiting for services to be up and running...

*** WARNING: Service runner-00929f5e-project-4-concurrent-0-mysql-0 probably didn't start properly.

Error response from daemon: Cannot link to a non running container: /runner-00929f5e-project-4-concurrent-0-mysql-0 AS /runner-00929f5e-project-4-concurrent-0-mysql-0-wait-for-service/runner-00929f5e-project-4-concurrent-0-mysql-0

2018-02-13T08:49:03.752410664Z 
2018-02-13T08:49:03.752468595Z ERROR: mysqld failed while attempting to check config
2018-02-13T08:49:03.752476292Z command was: "mysqld --verbose --help"
2018-02-13T08:49:03.752481759Z 
2018-02-13T08:49:03.752486693Z mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 13 - Permission denied)
2018-02-13T08:49:03.752491885Z mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

已设置变量:

variables:
  MYSQL_DATABASE: test
  MYSQL_ROOT_PASSWORD: password

我应该怎么做才能调试和解决此问题?

What should I do to debug and fix this issue?

推荐答案

您需要更改docker compose文件,您应该添加 privileged:true 我的外观如下:

you need to change your docker compose file, you should add privileged: true mine looks like :

  mysql:
    build: ./DockerFiles/Mysql
    ports:
    - ${LOCAL_PHP_IP}:${MYSQL_PORT}:3306
    privileged: true
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
    - /opt/mysql_data:/var/lib/mysql

这篇关于gitlabRunner:mysqld:无法读取"/etc/mysql/conf.d/"的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆