Dockerfile 1022 B

12345678910111213141516171819202122
  1. FROM mariadb:latest
  2. # as builder
  3. # That file does the DB initialization but also runs mysql daemon, by removing the last line it will only init
  4. # RUN ["sed", "-i", "s/exec \"$@\"/echo \"not running $@\"/", "/usr/local/bin/docker-entrypoint.sh"]
  5. # needed for intialization
  6. ENV MARIADB_ROOT_PASSWORD=zmKHxWvm3zWK6h69ZJHk
  7. COPY setup.sql /docker-entrypoint-initdb.d/
  8. # # Need to change the datadir to something else that /var/lib/mysql because the parent docker file defines it as a volume.
  9. # # https://docs.docker.com/engine/reference/builder/#volume :
  10. # # Changing the volume from within the Dockerfile: If any build steps change the data within the volume after
  11. # # it has been declared, those changes will be discarded.
  12. # RUN ["/usr/local/bin/docker-entrypoint.sh", "mysqld", "--datadir", "/initialized-db", "--aria-log-dir-path", "/initialized-db"]
  13. # RUN ls -lah /initialized-db
  14. # FROM mariadb:latest
  15. # ENV MARIADB_ROOT_PASSWORD=zmKHxWvm3zWK6h69ZJHk
  16. # COPY --from=builder /initialized-db /var/lib/mysql