• 15

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Install mysql-5.6 non interactive

I couldn't find any solutions how to install mysql-5.6 in a docker container non-interactively. I found the following commands but they need user input:

# Update the repo list, execute :
wget http://repo.mysql.com/mysql-apt-config_0.2.1-1debian7_all.deb
dpkg -i mysql-apt-config_0.2.1-1debian7_all.deb

# Install
apt-get update
apt-get install mysql-server-5.6

Is there a better solution for non-interactive installation?

To install mysql56 with docker, you should really be using following:

MySQL is a widely used, open-source relational database management system (RDBMS).


$ docker run -d mysql:5.6
Unable to find image 'mysql:5.6' locally
Trying to pull repository docker.io/library/mysql ... 5.6: Pulling from library/mysql

23286f48d129: Pull complete 
cbee5247e891: Pull complete 
ed751d9dbe3b: Pull complete 
66a9f45a6f88: Pull complete 
f50b60617e9c: Pull complete 
c03269bf1687: Pull complete 
b14dd0099b51: Pull complete 
9acd57cae939: Pull complete 
3153a44fc5c3: Pull complete 
8b36d77ab230: Pull complete 
d574478a62d8: Pull complete 
ac82a224055d: Pull complete 
e3ce3c9ce67d: Pull complete 
57c790472a9d: Pull complete 
49772bf40877: Pull complete 
73f07a1d187e: Pull complete 
3446fa8ab4bb: Pull complete 
70c40ffe6275: Pull complete 
54672d2ddb6f: Pull complete 
Digest: sha256:03646869dfecf96f443640f8b9040fbde78a96269aaf47bbfbb505a4c1adcad9
Status: Downloaded newer image for docker.io/mysql:5.6


OR, you can use Docker Compose as well.

  • 0
Reply Report
      • 1
    • I know, but I want nginx, php and mysql in one container and I use a nginx image, so I have to install mysql on my own.
      • 2
    • I know docker is not meant to use everything in one container :-) But I have the requirement for that so I have to do it :-) Background: We have a server with little demo instances of a web application. We don't want to use 3 container (mysql, php, nginx) for every demo instance, as we have very many many demo instances.

I'm not sure if this works with dpkg, as I rarely use debian, but Unix in general has a method of making an interactive task scriptable:

shell#] cat > answers.txt << EOF
shell#] interactive-command < answers.txt

Each line in the answers.txt file answers one question of the interactive setup process. You don't have to use the HERE document like in the example; vim, pico, nano, whatever can create the answer file.

In a Dockerfile you could ADD the answers.txt file, then RUN the command, piping the answers file to the stdin of the interactive command.

  • 0
Reply Report

Trending Tags