You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data import in /docker-entrypoint-initdb.d will fail by default, because files are added with 0700 permissions by default and MySQL can not read them.
Here it is. I cache database contents, because otherwise container starts 20 minutes.
FROM mysql:5.7 as builder
ENV MYSQL_ALLOW_EMPTY_PASSWORD=yes
ENV MYSQL_DATABASE=owid
ENV DB_NAME=owid
ADD https://files.ourworldindata.org/owid_metadata.sql.gz /docker-entrypoint-initdb.d/00-metadata.sql.gz
ADD https://files.ourworldindata.org/owid_chartdata.sql.gz /docker-entrypoint-initdb.d/01-data.sql.gz
# https://github.com/docker-library/mysql/issues/624
#RUN chmod 0777 /docker-entrypoint-initdb.d/*
# Explicitly trigger database import to speed up mysqld startup in final image.
# --datadir is changed because default is volume that does not persist.
# https://serverfault.com/questions/796762/creating-a-docker-mysql-container-with-a-prepared-database-scheme/915845#915845
RUN ["/entrypoint.sh", "--datadir", "/init-db"]
FROM mysql:5.7
COPY --from=builder /init-db /var/lib/mysql
Unfortunately, #453 (and #643 😬 😇) are likely the most we're going to do here -- at least with those, there should be an appropriate error message when permissions are no good.
The data import in
/docker-entrypoint-initdb.d
will fail by default, because files are added with 0700 permissions by default and MySQL can not read them.https://hub.docker.com/_/mysql could mention that.
The text was updated successfully, but these errors were encountered: