The command '/bin/sh -c mysql -u wordpress -pwordpress wordpress < /docker-entrypoint-initdb.d/wordpress.sql' returned a non-zero code: 1
My docker File :
From mysql:5.7
ENV MYSQL_ROOT_PASSWORD="************"
ENV MYSQL_USER="*******"
ENV MYSQL_PASSWORD="*********"
ENV MYSQL_DATABASE="********"
EXPOSE 3306 3366
COPY wordpress.sql /docker-entrypoint-initdb.d/.
RUN mysql -u wordpress -pwordpress wordpress < /docker-entrypoint-initdb.d/wordpress.sql
RUNanything -.sqlin/docker-entrypoint-initdb.d/will be automatically executed. Note though it will only run the first time the container is generated, so make sure to remove the container and any data volume and then try restarting. Some relevant links - example with Dockerfile, one with docker-compose. If it still fails, maybe some problem in your sql file.