0

Hi I am trying to start the dockerized image of adminer but am not able to connect to a ssl enabled mysql database. When I try to provide the plugin name as described in the official docker documentation. When I run the command

docker run -e ADMINER_PLUGINS='login-ssl' adminer

I am still getting the same error. the rrror says Create a file "/var/www/html/plugins-enabled/login-ssl.php" with the following contents to load the plugin:

<?php
require_once('plugins/login-ssl.php');

/** 
    * @param array array("key" => filename, "cert" => filename, "ca" => filename)
    */
return new AdminerLoginSsl(
    $ssl = ???
);

I created the same file as described in the suggestion but still the same issue. Can someone please help me with setting the adminer. Am I doing something wrong , please let me know.

1 Answer 1

0

If you mount the php files you don't need to specify the in the env ADMINER_PLUGINS

Here is my login-ssl.php

<?php
require_once('plugins/login-ssl.php');

$key = $_ENV['DB_SSL_KEY'];
$cert = $_ENV['DB_SSL_CERT'];
$ca = $_ENV['DB_SSL_CA'];

return new AdminerLoginSsl(
    $ssl = array("key" => $key, "cert" => $cert, "ca" => $ca)
);

Here is my docker-compose.yml

version: '3.7'

services:
  adminer:
    image: adminer:4.7.7-standalone
    ports:
      - 8080:8080
    environment:
      ADMINER_DESIGN: nette
      ADMINER_DEFAULT_SERVER: DB_IP_OR_HOST
      DB_SSL_KEY: '/certs/client-key.pem'
      DB_SSL_CERT: '/certs/client-cert.pem'
      DB_SSL_CA: '/certs/ca.pem'
    volumes:
      - ./login-ssl.php:/var/www/html/plugins-enabled/login-ssl.php
      - ./client-key.pem:/certs/client-key.pem
      - ./client-cert.pem:/certs/client-cert.pem
      - ./ca.pem:/certs/ca.pem
    restart: on-failure

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.