Hi! I’m new in Docker, I want to set my environment to learn on my own.
I have a problem when I run my Dockerfile and docker-compose.yml to build MySQL
My problem:2 mysql images downloaded when i run command docker-compose up --build
There are 2 images MySQL in tag “8.0” and “none” after docker-compose completed
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 8.0 f3f9ffb4e94e 14 seconds ago 547MB
mysql <none> 9228ee8bac7a 9 days ago 547MB
centos latest 470671670cac 2 months ago 237MB
nginxdemos/hello latest aedf47d433f1 2 years ago 16.8MB
I guess there is some problem in my Dockerfile or docker-compose.yml, but I have no idea why.
I attached my Dockerfile and docker-compose.yml
1.docker-compose.yml
version: '3.3'
services:
# DB config
db:
image: mysql:8.0
build: ./mysql
container_name: mysql
volumes:
- ./mysql/db:/docker-entrypoint-initdb.d
environment:
- MYSQL_DATABASE=webapp
- MYSQL_ROOT_USER=root
- MYSQL_ROOT_PASSWORD=password
- TZ=Japan
ports:
- "3306:3306"
2.Dockerfile
FROM mysql:8.0
COPY ./my.cnf /etc/mysql/conf.d/my.cnf
RUN mkdir -p /var/log/mysql
RUN chown mysql.mysql /var/log/mysql
Thank you all so much about reading my question.
Im so sorry about my English.