我正在尝试创建一个应用程序的映像,我正在创建一个ude应用程序,它是一个使用mysql数据库的javaspring启动rest应用程序。问题是:我做的步骤和我老师在视频中展示的一样,但由于某些原因,我的docker无法运行图像。以下是docker-compose.yml和dockerfile以及日志:
docker-compose.yml公司
version: '3.4'
services:
db:
image: raphasalomao/restudemy
command: mysqld --default-authentication-plugin=mysql_native_password
restart: always
build:
context: .
dockerfile: Dockerfile
environment:
TZ: America/Sao_Paulo
MYSQL_ROOT_PASSWORD: docker
MYSQL_USER: docker
MYSQL_PASSWORD: docker
MYSQL_DATABASE: restudemy
ports:
- "3308:3306"
networks:
- udemy-network
restudemy:
image: raphasalomao/restudemy
restart: always
build: /Users/rapha/OneDrive/Documentos/Projetos/RestUdemy/02 RestWithSpringBoot
working_dir: /Users/rapha/OneDrive/Documentos/Projetos/RestUdemy/02 RestWithSpringBoot
environment:
TZ: America/Sao_Paulo
SPRING_BOOT_ENVIRONMENT: Production
volumes:
- ./02 RestWithSpringBoot:/Users/rapha/OneDrive/Documentos/Projetos/RestUdemy/02 RestWithSpringBoot
- ~/.m2:/root/.m2
ports:
- "8080:8080"
command: mvn clean spring-boot:run
links:
- db
depends_on:
- db
networks:
- udemy-network
networks:
udemy-network:
driver: bridge
dockerfile文件:
FROM mysql:5.7.23
EXPOSE 3308
``
LOG:
>/usr/local/bin/mvn-entrypoint.sh: 50: exec: mysqld: not found
I've tried to change the $PATH on wsl, use mysqld.exe instead of mysql, update Windows, install docker and WSL again, but nothing works
1条答案
按热度按时间mnemlml81#
我发现了这个问题,其实这是我第一次用docker,对docker不太了解,但是问题是mysql的镜像,我把“image:raphasalomao/restudemy”改成了“image:mysql:5.7"