Error running docker compose file:
ERROR: for yingxue_mysql_1 Cannot create container for service mysql: invalid volume specification: 'yingxue_data:var/lib/mysql:rw': invalid mount config for type "volume": invalid mount path: 'var/lib/mysql' mount path must be absolute ERROR: for mysql Cannot create container for service mysql: invalid volume specification: 'yingxue_data:var/lib/mysql:rw': invalid mount config for type "volume": invalid mount path: 'var/lib/mysql' mount path must be absolute ERROR: Encountered errors while bringing up the project.
Docker compose original file
version: "3.3" networks: yingxue_network: volumes: data: services: nacos: image: nacos/nacos-server:2.0.2 ports: - "8848:8848" environment: - "JVM_XMS=256m" - "JVM_XMX=256m" - "MODE=standalone" networks: - yingxue_network mysql: image: mysql:5.7 ports: - "3306:3306" networks: - yingxue_network volumes: - data:var/lib/mysql - ./yingxue.sql:/docker-entrypoint-initdb.d/yingxue.sql environment: - "MYSQL_ROOT_PASSWORD=root" - "MYSQL_DATABASE=yingxue"
The problem description shows that the path is wrong. After careful inspection, it is found that the data volume data: var/lib/MySQL is missing /, which should be:
volumes: - data:/var/lib/mysql - ./yingxue.sql:/docker-entrypoint-initdb.d/yingxue.sql
- No repositories directory found inside registry_ DATA_ DIR
- How to Solve “Error db.num is null” when starting Nacos
- docker load Error processing tar file(exit status 1): archive/tar: invalid tar header
- Nacos Error: server is DOWN now, please try again later! [How to Solve]
- Docker service startup error: Job for docker.service failed because the control process exited with error code.
- MAC: How to modify the docker container error [screen is terminating]
- [Solved] Fabric 2.x: error starting container: API error (404): network_test not found
- Vagrant up Error: Warning: Authentication failure. Retrying…[How to Solve]
- [Solved] CentOS build a docker error: job for docker.service failed….
- The drone settings page is not trusted
- Openstack virtual machine disk IO error [How to Solve]
- How to Solve Docker failed to initialize Error
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket
- Docker Create tomcat Error standard_init_linux.go:211: exec user process caused “no such file or directory”
- MacOS Mojave uses SMB LAN share as backup disk of timemachine time machine. Disk does not support time machine backups. (error 45)
- [Solved] Nacos Start Error: failed to req API:127.0.0.1:8848/nacos/v1/ns/service/list. code:503 msg: server is DOWN now
- [Solved] MSP430F5529 Error initializing emulator:No USB FET was found
- [environment] docker: error response from daemon: OCI runtime
- [Solved] Error(22) WARNING: IPv4 forwarding is disabled. Networking will not work.
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String