Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In "Initializing a fresh instance" mention 0777 privileges for dumps #654

Closed
abitrolly opened this issue Mar 27, 2020 · 3 comments
Closed

Comments

@abitrolly
Copy link

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.

@wglambert
Copy link

Can you give all the commands you ran and any relevant contextual information or files for reproducing the issue

Mounting a .sh file for example with 755 permissions will keep those in the container and the entrypoint will execute it.

@abitrolly
Copy link
Author

abitrolly commented Mar 28, 2020

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

@tianon
Copy link
Member

tianon commented Jun 8, 2022

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.

@tianon tianon closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants