Skip to content

Instantly share code, notes, and snippets.

@cgrs
Created June 19, 2017 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgrs/75a522bbd9f5546a19b5438d0ef3bc17 to your computer and use it in GitHub Desktop.
Save cgrs/75a522bbd9f5546a19b5438d0ef3bc17 to your computer and use it in GitHub Desktop.
MariaDB on Alpine Linux (armhf)
FROM alpine:armhf
RUN apk update && apk add --no-cache mariadb mariadb-client
ADD setup.sh /setup.sh
RUN chmod a+x /setup.sh && ./setup.sh && rm -f /setup.sh
ENTRYPOINT ["mysqld_safe"]
EXPOSE 3306
#!/bin/sh
mysql_install_db --user=mysql
temp=`mktemp`
cat <<EOF > $temp
USE mysql;
FLUSH PRIVILEGES;
CREATE USER 'root'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
EOF
mysqld --user=mysql --bootstrap < $temp
rm -f $temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment