Skip to content

Instantly share code, notes, and snippets.

@dalguete
Created August 11, 2014 04:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalguete/cd2dc5471530b8df00da to your computer and use it in GitHub Desktop.
Save dalguete/cd2dc5471530b8df00da to your computer and use it in GitHub Desktop.
Here some files to reproduce the MySQL-Privileged problem
#!/bin/sh
sudo docker build -t mysql-test .
# MySQL
FROM ubuntu
RUN apt-get update
RUN echo "mysql-server-5.5 mysql-server/root_password password root123" | debconf-set-selections
RUN echo "mysql-server-5.5 mysql-server/root_password_again password root123" | debconf-set-selections
RUN echo "mysql-server-5.5 mysql-server/root_password seen true" | debconf-set-selections
RUN echo "mysql-server-5.5 mysql-server/root_password_again seen true" | debconf-set-selections
RUN apt-get install -y mysql-server mysql-client telnet
######################
### Non Privileged ###
######################
sudo docker run -it mysql-test bash
# Inside container
/etc/init.d/mysql start
telnet localhost 3306 # <-WORKS
##################
### Privileged ###
##################
sudo docker run --privileged -it mysql-test bash
# Inside container
/etc/init.d/mysql start
# A lot of '/usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: Permission denied'
######################
### Non Privileged ###
######################
sudo docker run -it mysql-test bash
# Inside container
/usr/bin/mysqld_safe &
telnet localhost 3306 # <-WORKS
##################
### Privileged ###
##################
sudo docker run --privileged -it mysql-test bash
# Inside container
/usr/bin/mysqld_safe &
telnet localhost 3306 # <-DOES NOT WORK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment