Skip to content

Creating my own mysql image #214

Closed
Closed
@mjdavies

Description

@mjdavies

Hi Everyone

I'm pretty sure this isn't an issue with the library, more an issue with me doing something wrong.

This is what I'm trying to accomplish.

Create an image of mysql mysql:5.6.33, with the listen address set to anywhere, and then use a grant statement to give a user permission to access all the databases, from anywhere, with a password.

I'm trying to do this in a Dockerfile, but I keep bumping into problems and it's driving me nuts.

It can't be this hard, so I must be doing something stupid.

This is where I'm currently at in my Dockerfile, I've tried 'alot' of things to get it to work, no joy so far :-(

FROM mysql:5.6.33
RUN mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
ENV MYSQL_ROOT_PASSWORD bigballs
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
RUN /usr/sbin/mysqld & \
    sleep 10s &&\
    echo "GRANT ALL ON *.* TO bobby@'%' IDENTIFIED BY 'bigballs' WITH GRANT OPTION; FLUSH PRIVILEGES" | mysql
EXPOSE 3306
CMD ["mysqld_safe"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions