Skip to content

Commit

Permalink
Refactor envsubst script
Browse files Browse the repository at this point in the history
  • Loading branch information
Dove6 committed Nov 16, 2021
1 parent 70f323d commit 61fed1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions 10-envsubst-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SUBSTITUTED_FILE="/etc/mysql/conf.d/slave.cnf"
(echo "cat <<EOF"; cat "$SUBSTITUTED_FILE.template"; echo EOF) | sh >"$SUBSTITUTED_FILE"
cat "$SUBSTITUTED_FILE"
2 changes: 0 additions & 2 deletions 40-envsubst-config.sh

This file was deleted.

4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM mysql:5.7.8

COPY slave.cnf.template /etc/mysql/conf.d/
COPY --chmod=0777 40-envsubst-config.sh /docker-entrypoint-initdb.d/
COPY --chmod=0777 10-envsubst-config.sh /docker-entrypoint-initdb.d/

EXPOSE 3306

CMD ["mysqld"]

0 comments on commit 61fed1a

Please sign in to comment.