gpt4 book ai didi

mysql - Docker-compose 在 CircleCI 中复制 MySQL 配置时出现问题

转载 作者:行者123 更新时间:2023-11-29 10:01:15 25 4
gpt4 key购买 nike

以下内容在本地计算机上运行良好,但在 checkin CircleCI 时失败:

mysql:
image: mysql:5.7
ports:
- 3306:3306
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_ROOT_HOST=%
restart: always
volumes:
- ./docker/mysql/mysqld.cnf:/etc/mysql/conf.d/mysql.cnf

checkout 的项目下有./docker/mysql/mysqld.cnf文件。

CircleCi 上显示的错误是:

ERROR: for proj-server_mysql_1 Cannot start service mysql: b'oci runtime error: container_linux.go:265: starting container process caused "process_linux.go:368: container init caused \"rootfs_linux.go:57: mounting \\\"/home/circleci/max/proj-server/docker/mysql/mysqld.cnf\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/4a9af90d342b491ae92af5a88360d2e34fce0d21c15f8a648767e89fb51aa\\\" at \\\"/var/lib/docker/aufs/mnt/4a9af90d342b491ae92af5a88360d2e34fce0d21c15f8a648767e89fb51aa/etc/mysql/conf.d/mysql.cnf\\\" caused \\\"not a directory\\\"\""\n: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type'

最佳答案

It's not possible to use volume mounting with the docker executor, but with using the machine executor it's possible to mount local directories to your running Docker containers. You can learn more about the machine executor here on our docs page.

https://support.circleci.com/hc/en-us/articles/360007324514-How-can-I-mount-volumes-to-docker-containers-

关于mysql - Docker-compose 在 CircleCI 中复制 MySQL 配置时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52909130/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com