解决cannot mount volume over existing file, file exists /var/lib/docker/aufs/mnt/

问题: cannot mount volume over existing file, file exists /var/lib/docker/aufs/mnt/0ac71fed1af802a4ecf4a93bd2b3a7b2e6adab2cf93ee28357712afe6d5e1f47/etc/nginx/nginx.conf

我用docker搭建php开发坏境的时候 ,遇到了上面的问题,经过查询 ,这是一个低版本docker-compose 的bug,
我当时用的是1.1版本,我根据官方的文档卸载了docker-compose ,重新安装了更高的版本;
官方文档链接是https://docs.docker.com/compose/install/
1

Uninstallation
To uninstall Docker Compose if you installed using curl:

$ rm /usr/local/bin/docker-compose

2

$ curl -L https://github.com/docker/compose/releases/download/1.6.0/run.sh > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose

3 docker-compose up -d

完美解决了上面的问题.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
It seems that you are encountering an issue where the original data directory "/var/lib/mysql" is not empty. This can happen if there are existing files or directories present in that location before attempting to use it for MySQL. To resolve this issue, you have a few options: 1. Backup and remove existing data: If you don't need the existing data, you can back it up and then remove all the files and directories within the "/var/lib/mysql" directory. You can use the following commands to perform this: ``` sudo service mysql stop sudo mv /var/lib/mysql /var/lib/mysql_backup sudo mkdir /var/lib/mysql sudo chown -R mysql:mysql /var/lib/mysql sudo service mysql start ``` Please note that this will delete all the existing data, so make sure to back it up if you need it. 2. Specify a different data directory: If you want to keep the existing data intact, you can configure MySQL to use a different data directory. To do this, you need to edit the MySQL configuration file (usually located at "/etc/mysql/my.cnf" or "/etc/my.cnf") and change the "datadir" parameter to a different directory path. After making the change, restart MySQL for the new configuration to take effect. ``` sudo nano /etc/mysql/my.cnf # Find the line starting with "datadir" and change its value to a new directory path sudo service mysql restart ``` Remember to ensure that the new directory has sufficient permissions for the MySQL user. By following one of these approaches, you should be able to resolve the issue of the original data directory not being empty.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值