Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
FROM adminer:latest

COPY ./html /var/www/html/

ENV LOGIN_SERVERS = '{}'
ENV PHP_CLI_SERVER_WORKERS = 5
FROM adminer:latest

COPY init_container.sh ./
COPY ./html /var/www/html/

ENV LOGIN_SERVERS = '{}'
ENV PHP_CLI_SERVER_WORKERS = 5

# Set up SSH
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "root:Docker!" | chpasswd \
&& chmod u+x ./init_container.sh
COPY conf/sshd_config /etc/ssh/
EXPOSE 8000 2222

ENTRYPOINT [ "./init_container.sh" ]
61 changes: 32 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
# Adminer for Azure MySQL Single & Flexible Server

[![Docker Pulls](https://badgen.net/docker/pulls/assoconnect/adminer-azure?icon=docker&label=pulls)](https://hub.docker.com/r/assoconnect/adminer-azure/)
[![Docker Stars](https://badgen.net/docker/stars/assoconnect/adminer-azure?icon=docker&label=stars)](https://hub.docker.com/r/assoconnect/adminer-azure/)
[![Docker Image Size](https://badgen.net/docker/size/assoconnect/adminer-azure?icon=docker&label=image%20size)](https://hub.docker.com/r/assoconnect/adminer-azure/)

This image based on the official [Adminer Docker image](https://hub.docker.com/_/adminer) ships the required setup to connect with SSL to an Azure MySQL Single or Flexible Server.

A daily build is available on the [Docker Hub](https://hub.docker.com/r/assoconnect/adminer-azure).

## Login SSL
This image ships with the required setup to connect with SSL to an Azure MySQL Single or Flexible Server.) ships the required setup to connect with SSL to an Azure MySQL Single or Flexible Server
* https://learn.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-ssl
* https://learn.microsoft.com/en-us/azure/mysql/flexible-server/how-to-connect-tls-ssl

## Login Servers
This images also leverage the `login-servers.php` plugin to provide a predefined list of servers.

Define the env variable `LOGIN_SERVERS` as JSON-encoded list of servers
```
{
"server description": {
"server": "[host]",
"driver": "[server|pgsql|sqlite|...]"
},
...
}
```
_Note that the `server` driver is Adminer's internal name for MysQL._
# Adminer for Azure MySQL Single & Flexible Server

[![Docker Pulls](https://badgen.net/docker/pulls/assoconnect/adminer-azure?icon=docker&label=pulls)](https://hub.docker.com/r/assoconnect/adminer-azure/)
[![Docker Stars](https://badgen.net/docker/stars/assoconnect/adminer-azure?icon=docker&label=stars)](https://hub.docker.com/r/assoconnect/adminer-azure/)
[![Docker Image Size](https://badgen.net/docker/size/assoconnect/adminer-azure?icon=docker&label=image%20size)](https://hub.docker.com/r/assoconnect/adminer-azure/)

This image based on the official [Adminer Docker image](https://hub.docker.com/_/adminer) ships the required setup to connect with SSL to an Azure MySQL Single or Flexible Server.

A daily build is available on the [Docker Hub](https://hub.docker.com/r/assoconnect/adminer-azure).

## Login SSL
This image ships with the required setup to connect with SSL to an Azure MySQL Single or Flexible Server.) ships the required setup to connect with SSL to an Azure MySQL Single or Flexible Server
* https://learn.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-ssl
* https://learn.microsoft.com/en-us/azure/mysql/flexible-server/how-to-connect-tls-ssl

## Login Servers
This images also leverage the `login-servers.php` plugin to provide a predefined list of servers.

Define the env variable `LOGIN_SERVERS` as JSON-encoded list of servers
```
{
"server description": {
"server": "[host]",
"driver": "[server|pgsql|sqlite|...]"
},
...
}
```
_Note that the `server` driver is Adminer's internal name for MysQL._

## Azure Portal SSH
This images also ships with the [required configuration](https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?tabs=debian&pivots=container-linux#enable-ssh) to enable an SSH access through the Azure web portal.
12 changes: 12 additions & 0 deletions conf/sshd_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Port 2222
ListenAddress 0.0.0.0
LoginGraceTime 180
X11Forwarding yes
Ciphers aes256-cbc,aes256-ctr
MACs hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
Subsystem sftp internal-sftp
6 changes: 6 additions & 0 deletions init_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Prints all command to stdout (for debug purpose)
set -e

service ssh start
Copy link
Copy Markdown
Contributor

@sylfabre sylfabre Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep infinity is missing to prevent the script from exiting (which kills the container)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really required?
I don't see it anywhere in our delivery repository or in Azure's documentation.