skip to Main Content

as a first… yes…yes I know there are 1000 questions and solutions to this. But unfortunately none of them helps me.

Let’s get to the problem:

I have a Docker container running on which MySQL is configured. Now I would like to change the bind address from 127.0.0.1 to 0.0.0.0. Unfortunately I can’t open my.cnf because I don’t have nano, vim installed. With apk, yum, vim, apt-get and so on I get that:

apt-get: command not found
apk: command not found
...

Could someone of you maybe help me out with my little problem?
best thanks and greetings

2

Answers


  1. You could do a docker cp to copy the file out of the container, edit it, and then docker cp it back in again. This may be fine if you need to do this for troubleshooting, but you probably want to look at fixing this in your deployment process. You should be able to destroy and re-create the docker container without having to manually fix configurations. This should be handled in your Dockerfile, or perhaps copying the correct configuration file in in your docker compose file.

    Login or Signup to reply.
  2. The default for MySQL docker image has been changed to Oracle based Linux distribution. In this distribution, the default package manager is yum. If for whatever reason you still want to use apt, pull Debian image explicitly. Something like mysql:8-debian.

    See this issue for more detail.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search