Compare commits

...

4 Commits

Author SHA1 Message Date
Asif Bacchus
ed6e9cfe63 docs: fix container name 2020-12-27 04:28:37 -07:00
Asif Bacchus
c5be56fb59 fix: chown files in entrypoint vs dockerfile
- init directories chown'd in entrypoint vs dockerfile
- sets proper UID and GID instead of system default
2020-12-27 04:15:32 -07:00
Asif Bacchus
e4df2adce6 feature(DOCKERFILE): use edge repo
- change alpine repo to EDGE so latest versions can be used
- update mariaDB minor version
2020-12-27 04:08:10 -07:00
Asif Bacchus
7e10cf3996 build: Rider project config files 2020-12-27 01:57:42 -07:00
9 changed files with 172 additions and 6 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelStore">
<e p="C:\Users\AsifB\AppData\Local\JetBrains\Rider2020.3\extResources" t="IncludeRecursive" />
<e p="C:\Users\AsifB\AppData\Local\JetBrains\Rider2020.3\resharper-host\Local\Transient\Rider\v203\SolutionCaches\_.19.00" t="ExcludeRecursive" />
<e p="C:\Users\AsifB\RiderProjects\mariadb-alpine" t="IncludeFlat" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelUserStore">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.mariadb-alpine.dir/.idea/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.mariadb-alpine.dir/.idea/riderModule.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="2" />
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="114c4900-1ad3-480d-a423-ea02ef8f6005" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitToolBoxStore">
<option name="projectConfigVersion" value="2" />
</component>
<component name="IdeDocumentHistory">
<changedPaths>
<option value="$PROJECT_DIR$/entrypoint.sh" />
<option value="$PROJECT_DIR$/Dockerfile" />
</changedPaths>
</component>
<component name="ProjectId" id="1mEUx5cS7E0AfMFfANhfLJYwTfS" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="autoscrollToSource" value="true" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="RunManager">
<configuration name="Docker Image" type="docker-deploy" factoryName="docker-image" temporary="true" server-name="Docker">
<deployment type="docker-image">
<settings>
<option name="imageTag" value="docker.asifbacchus.app/mariadb/mariadb-alpine:10.5" />
<option name="command" value="" />
<option name="containerName" value="db" />
<option name="entrypoint" value="" />
<option name="commandLineOptions" value="--rm" />
</settings>
</deployment>
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Docker.Docker Image" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="114c4900-1ad3-480d-a423-ea02ef8f6005" name="Default Changelist" comment="" />
<created>1609058490002</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1609058490002</updated>
<workItem from="1609058494288" duration="604000" />
<workItem from="1609059119559" duration="214000" />
<workItem from="1609059354834" duration="7502000" />
</task>
<task id="LOCAL-00001" summary="build: Rider project config files">
<created>1609059462884</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1609059462884</updated>
</task>
<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>
<task id="LOCAL-00003" summary="fix: chown files in entrypoint vs dockerfile&#10;&#10;- init directories chown'd in entrypoint vs dockerfile&#10;- sets proper UID and GID instead of system default">
<created>1609067732307</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1609067732307</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
<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" />
<MESSAGE value="fix: chown files in entrypoint vs dockerfile&#10;&#10;- init directories chown'd in entrypoint vs dockerfile&#10;- sets proper UID and GID instead of system default" />
<option name="LAST_COMMIT_MESSAGE" value="fix: chown files in entrypoint vs dockerfile&#10;&#10;- init directories chown'd in entrypoint vs dockerfile&#10;- sets proper UID and GID instead of system default" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

View File

@ -6,16 +6,16 @@ FROM alpine:3.12
# standardized labels
LABEL maintainer="Asif Bacchus <asif@bacchus.cloud>"
LABEL org.label-schema.cmd="docker run -d --name db -v volume:/var/lib/mysql [-v /pre/exec/scripts:/docker-entrypoint-preinit.d] [-v /sql/scripts:/docker-entrypoint-initdb.d] [-v /post/exec/scripts:/docker-entrypoint-postinit.d] [-e TZ=Etc/UTC -e MYSQL_UID=8100 -e MYSQL_GID=8100 -e MYSQL_ROOT_PASSWORD=... -e MYSQL_DATABASE='myData' -e MYSQL_CHARSET='utf8mb4' -e MYSQL_COLLATION='utf8mb4_general_ci' -e MYSQL_USER=... -e MYSQL_PASSWORD=...] docker.asifbacchus.app/mariadb/mariadb-alpine:latest"
LABEL org.label-schema.cmd="docker run -d --name db -v volume:/var/lib/mysql [-v /pre/exec/scripts:/docker-entrypoint-preinit.d] [-v /sql/scripts:/docker-entrypoint-initdb.d] [-v /post/exec/scripts:/docker-entrypoint-postinit.d] [-e TZ=Etc/UTC -e MYSQL_UID=8100 -e MYSQL_GID=8100 -e MYSQL_ROOT_PASSWORD=... -e MYSQL_DATABASE='myData' -e MYSQL_CHARSET='utf8mb4' -e MYSQL_COLLATION='utf8mb4_general_ci' -e MYSQL_USER=... -e MYSQL_PASSWORD=...] docker.asifbacchus.app/mariadb/ab-mariadb-alpine:latest"
LABEL org.label-schema.description="mariadb running on Alpine Linux."
LABEL org.label-schema.name="mariadb-alpine"
LABEL org.label-schema.name="ab-mariadb-alpine"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.url="https://git.asifbacchus.app/ab-docker/mariadb-alpine"
LABEL org.label-schema.usage="https://git.asifbacchus.app/ab-docker/mariadb-alpine/wiki"
LABEL org.label-schema.vcs-url="https://git.asifbacchus.app/ab-docker/mariadb-alpine.git"
# install mariadb and turn on TCP connection in default config
RUN apk --no-cache add \
RUN apk --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main add \
tzdata \
mariadb \
mariadb-client \
@ -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" ]
@ -55,5 +54,5 @@ CMD [ "/usr/bin/mysqld", "--user=mysql", "--console" ]
# add build date and version labels
ARG BUILD_DATE
LABEL org.label-schema.build-date=${BUILD_DATE}
LABEL org.label-schema.vendor="mariaDB (10.5.6-r0)"
LABEL org.label-schema.vendor="mariaDB (10.5.8-r0)"
LABEL org.label-schema.version="1.0"

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