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
You don't need the last line "RUN ..."
Mysql container automatically runs whatever you copy in /docker-entrypoint-initdb.d/
. This happens when you run the container, not during build.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.