-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Adminer official image #2252
Conversation
Any contact with upstream yet? 🙏 (to either see if they're interested in collaboration, or to ensure that they're not opposed to the creation of this image/possibly provide their blessing for you doing so ❤️) |
As a short heads up: Not yet, I'm busy at the moment. This has not been forgotten. |
@tianon I just wanted to contact upstream via the official adminer forum in SourceForge. I even bit the bullet to register a SourceForge account, unfortunately SourceForge does not want my account and is unable to configure their mail servers properly (i.e. the activation mail does not arrive). To be honest it looks like the adminer developer does not even frequent that discussion board any more, anyway. Please advice on how to proceed 🙏 |
@TimWolla I suppose we probably are fine to move forward 👍 (but I'll say explicitly here that if upstream comes around later and is reading this, we'll be ecstatic to help coordinate the cooperation ❤️) |
diff --git a/adminer_fastcgi/Dockerfile b/adminer_fastcgi/Dockerfile
new file mode 100644
index 0000000..fbe1954
--- /dev/null
+++ b/adminer_fastcgi/Dockerfile
@@ -0,0 +1,25 @@
+FROM php:7.0-fpm-alpine
+MAINTAINER Tim Düsterhus
+
+RUN addgroup -S adminer \
+&& adduser -S -G adminer adminer \
+&& mkdir -p /var/www/html
+
+RUN apk add --no-cache libpq
+
+RUN set -x \
+&& apk add --no-cache --virtual .build-deps \
+ postgresql-dev \
+ sqlite-dev \
+&& docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite \
+&& apk del .build-deps
+
+COPY index.php .
+
+ENV ADMINER_VERSION 4.2.5
+ENV ADMINER_DOWNLOAD_SHA256 a8d9f5df8a604e75e87670bc1d797bb49cc1047f722a8630bda514fdc407f84f
+
+RUN curl -fsSL https://www.adminer.org/static/download/$ADMINER_VERSION/adminer-$ADMINER_VERSION-en.php -o adminer.php \
+&& echo "$ADMINER_DOWNLOAD_SHA256 adminer.php" |sha256sum -c -
+
+USER adminer
diff --git a/adminer_fastcgi/index.php b/adminer_fastcgi/index.php
new file mode 100644
index 0000000..6384334
--- /dev/null
+++ b/adminer_fastcgi/index.php
@@ -0,0 +1,26 @@
+<?php
+namespace docker {
+ function adminer_object() {
+ class Adminer extends \Adminer {
+ function loginForm() {
+ ob_start();
+ $return = parent::loginForm();
+ $form = ob_get_clean();
+
+ echo str_replace('name="auth[server]" value="" title="hostname[:port]"', 'name="auth[server]" value="db" title="hostname[:port]"', $form);
+
+ return $return;
+ }
+ }
+
+ return new Adminer();
+ }
+}
+
+namespace {
+ function adminer_object() {
+ return \docker\adminer_object();
+ }
+
+ require('adminer.php');
+}
diff --git a/adminer_latest/Dockerfile b/adminer_latest/Dockerfile
new file mode 100644
index 0000000..3ed815f
--- /dev/null
+++ b/adminer_latest/Dockerfile
@@ -0,0 +1,30 @@
+FROM php:7.0-alpine
+MAINTAINER Tim Düsterhus
+
+RUN addgroup -S adminer \
+&& adduser -S -G adminer adminer \
+&& mkdir -p /var/www/html
+
+WORKDIR /var/www/html
+
+RUN apk add --no-cache libpq
+
+RUN set -x \
+&& apk add --no-cache --virtual .build-deps \
+ postgresql-dev \
+ sqlite-dev \
+&& docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite \
+&& apk del .build-deps
+
+COPY index.php .
+
+ENV ADMINER_VERSION 4.2.5
+ENV ADMINER_DOWNLOAD_SHA256 a8d9f5df8a604e75e87670bc1d797bb49cc1047f722a8630bda514fdc407f84f
+
+RUN curl -fsSL https://www.adminer.org/static/download/$ADMINER_VERSION/adminer-$ADMINER_VERSION-en.php -o adminer.php \
+&& echo "$ADMINER_DOWNLOAD_SHA256 adminer.php" |sha256sum -c -
+
+USER adminer
+CMD php -S 0.0.0.0:8080 -t /var/www/html
+
+EXPOSE 8080
diff --git a/adminer_latest/index.php b/adminer_latest/index.php
new file mode 100644
index 0000000..6384334
--- /dev/null
+++ b/adminer_latest/index.php
@@ -0,0 +1,26 @@
+<?php
+namespace docker {
+ function adminer_object() {
+ class Adminer extends \Adminer {
+ function loginForm() {
+ ob_start();
+ $return = parent::loginForm();
+ $form = ob_get_clean();
+
+ echo str_replace('name="auth[server]" value="" title="hostname[:port]"', 'name="auth[server]" value="db" title="hostname[:port]"', $form);
+
+ return $return;
+ }
+ }
+
+ return new Adminer();
+ }
+}
+
+namespace {
+ function adminer_object() {
+ return \docker\adminer_object();
+ }
+
+ require('adminer.php');
+} Build test of #2252; 07b3b8c ( $ bashbrew build adminer:4.2.5-standalone
Building bashbrew/cache:b2eb6597f11cb73925724b84104dded6cb85d9acb8e0fa0ff50186918cee5def (adminer:4.2.5-standalone)
Tagging adminer:4.2.5-standalone
Tagging adminer:4.2-standalone
Tagging adminer:4-standalone
Tagging adminer:standalone
Tagging adminer:4.2.5
Tagging adminer:4.2
Tagging adminer:4
Tagging adminer:latest
$ test/run.sh adminer:4.2.5-standalone
testing adminer:4.2.5-standalone
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'override-cmd' [4/4]...passed
$ bashbrew build adminer:4.2.5-fastcgi
Building bashbrew/cache:1bc77403f9819340ed87d879ad76b3c0599493867de8c7189f01f2df73a46241 (adminer:4.2.5-fastcgi)
Tagging adminer:4.2.5-fastcgi
Tagging adminer:4.2-fastcgi
Tagging adminer:4-fastcgi
Tagging adminer:fastcgi
$ test/run.sh adminer:4.2.5-fastcgi
testing adminer:4.2.5-fastcgi
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'override-cmd' [4/4]...passed
|
Quick link to the source repository
This adds an official image for the adminer database management tool.
The FastCGI version of this image received significant testing by myself, as I use it for my local development setup. The standalone version is new, but fairly similar to the FastCGI one and thus should work just fine.
As this image should not receive production like traffic levels the default standalone version uses the PHP internal develoment web server, which should work fine for any local usage. For developers running a FastCGI-capable web server anyway the FastCGI version might be preferred.
This image is opiniated in so far as it uses the host name
db
by default for the database, instead oflocalhost
which obviously does not work in context of Docker.This image differs from the very popular
clue/adminer
image in the following points:There is a PR on clue/adminer that remedies some of the points, but it heavily discussed, so I refrained from proposing my own opiniated solution there: clue/docker-adminer#21
Checklist for Review
NOTE: This checklist is intended for the use of the Official Images maintainers both to track the status of your PR and to help inform you and others of where we're at. As such, please leave the "checking" of items to the repository maintainers. If there is a point below for which you would like to provide additional information or note completion, please do so by commenting on the PR. Thanks! (and thanks for staying patient with us ❤️)
Not yet.
Yup, Add Adminer official image docs#722
foobar
needs Node.js, hasFROM node:...
instead of grabbingnode
via other means been considered?)Yup. Based on the alpine versions of PHP.
FROM scratch
, tarballs only exist in a single commit within the associated history?Does not apply