fix: chown files in entrypoint vs dockerfile

- init directories chown'd in entrypoint vs dockerfile
- sets proper UID and GID instead of system default
This commit is contained in:
Asif Bacchus 2020-12-27 04:15:32 -07:00
parent e4df2adce6
commit c5be56fb59
3 changed files with 19 additions and 6 deletions

View File

@ -2,9 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="114c4900-1ad3-480d-a423-ea02ef8f6005" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.run/build-datestampWindows.run.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.mariadb-alpine.dir/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.mariadb-alpine.dir/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/entrypoint.sh" beforeDir="false" afterPath="$PROJECT_DIR$/entrypoint.sh" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -19,6 +19,7 @@
</component>
<component name="IdeDocumentHistory">
<changedPaths>
<option value="$PROJECT_DIR$/entrypoint.sh" />
<option value="$PROJECT_DIR$/Dockerfile" />
</changedPaths>
</component>
@ -52,7 +53,7 @@
<updated>1609058490002</updated>
<workItem from="1609058494288" duration="604000" />
<workItem from="1609059119559" duration="214000" />
<workItem from="1609059354834" duration="6715000" />
<workItem from="1609059354834" duration="7172000" />
</task>
<task id="LOCAL-00001" summary="build: Rider project config files">
<created>1609059462884</created>
@ -61,7 +62,14 @@
<option name="project" value="LOCAL" />
<updated>1609059462884</updated>
</task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="feature(DOCKERFILE): use edge repo&#10;&#10;- change alpine repo to EDGE so latest versions can be used&#10;- update mariaDB minor version">
<created>1609067290388</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1609067290388</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -82,6 +90,11 @@
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
<MESSAGE value="build: Rider project config files" />
<option name="LAST_COMMIT_MESSAGE" value="build: Rider project config files" />
<MESSAGE value="feature(DOCKERFILE): use edge repo&#10;&#10;- change alpine repo to EDGE so latest versions can be used&#10;- update mariaDB minor version" />
<option name="LAST_COMMIT_MESSAGE" value="feature(DOCKERFILE): use edge repo&#10;&#10;- change alpine repo to EDGE so latest versions can be used&#10;- update mariaDB minor version" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

View File

@ -45,8 +45,7 @@ ENV MYSQL_PASSWORD=''
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN mkdir -p /docker-entrypoint-preinit.d \
&& mkdir -p /docker-entrypoint-initdb.d \
&& mkdir -p /docker-entrypoint-postinit.d \
&& chown -R mysql:mysql /docker-entrypoint-*
&& mkdir -p /docker-entrypoint-postinit.d
# set entrypoint and default command
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

View File

@ -54,6 +54,7 @@ fi
sed -i "s/mysql:x:100:101/mysql:x:${MYSQL_UID}:${MYSQL_GID}/" /etc/passwd
sed -i "s/mysql:x:101/mysql:x:${MYSQL_GID}/" /etc/group
chown -R mysql:mysql /var/lib/mysql
chown -R mysql:mysql /docker-entrypoint-*
# skip DNS reverse name resolution if option is set (default)
if [ "$MYSQL_SKIP_NAME_RESOLVE" = 'TRUE' ]; then