├── rootfs ├── etc │ └── php │ │ └── conf.d │ │ └── 99-adminer.ini ├── entrypoint.sh └── var │ └── www │ └── html │ ├── plugin-loader.php │ └── index.php ├── .github └── workflows │ ├── hub.yaml │ └── build.yml ├── Dockerfile └── README.md /rootfs/etc/php/conf.d/99-adminer.ini: -------------------------------------------------------------------------------- 1 | upload_max_filesize = 128M 2 | post_max_size = 128M 3 | memory_limit = 1G 4 | max_execution_time = 600 5 | max_input_vars = 5000 6 | -------------------------------------------------------------------------------- /.github/workflows/hub.yaml: -------------------------------------------------------------------------------- 1 | name: Sync Dockerhub Readme 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - README.md 9 | 10 | jobs: 11 | sync: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | 17 | - name: Docker Hub Description 18 | uses: peter-evans/dockerhub-description@v4 19 | with: 20 | username: shyim 21 | password: ${{ secrets.DOCKER_HUB_PAT }} 22 | repository: shyim/adminerevo 23 | -------------------------------------------------------------------------------- /rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | if [ -n "$ADMINER_DESIGN" ]; then 5 | # Only create link on initial start, to ensure that explicit changes to 6 | # adminer.css after the container was started once are preserved. 7 | if [ ! -e /tmp/.adminer-init ]; then 8 | ln -sf "designs/$ADMINER_DESIGN/adminer.css" /var/www/html/adminer.css 9 | fi 10 | fi 11 | 12 | mkdir -p /var/www/html/plugins-enabled || true 13 | 14 | number=1 15 | for PLUGIN in $ADMINER_PLUGINS; do 16 | php /var/www/html/plugin-loader.php "$PLUGIN" > /var/www/html/plugins-enabled/$(printf "%03d" $number)-$PLUGIN.php 17 | number=$(($number+1)) 18 | done 19 | 20 | touch /tmp/.adminer-init || true 21 | 22 | exec "$@" 23 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM cgr.dev/chainguard/wolfi-base 2 | 3 | ARG ADMINEREVO_VERSION=4.8.4 4 | 5 | RUN apk add --no-cache \ 6 | php-8.3 \ 7 | php-8.3-curl \ 8 | php-8.3-pdo \ 9 | php-8.3-pdo_mysql \ 10 | php-8.3-pdo_sqlite \ 11 | php-8.3-pdo_pgsql \ 12 | php-8.3-mysqlnd \ 13 | php-8.3-pdo_dblib \ 14 | php-8.3-opcache 15 | 16 | COPY rootfs / 17 | 18 | RUN set -x \ 19 | && apk add --no-cache git curl \ 20 | && curl -fsSL "https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php" -o /var/www/html/adminer.php \ 21 | && git clone --recurse-submodules=designs --depth 1 --shallow-submodules --branch "v$ADMINEREVO_VERSION" https://github.com/adminerevo/adminerevo.git /tmp/adminer \ 22 | && cp -r /tmp/adminer/designs/ /tmp/adminer/plugins/ /var/www/html \ 23 | && rm -rf /tmp/adminer/ \ 24 | && chown -R nonroot:nonroot /var/www/html \ 25 | && apk del git 26 | 27 | ENTRYPOINT [ "/entrypoint.sh" ] 28 | USER nonroot 29 | EXPOSE 8080 30 | ENV PHP_CLI_SERVER_WORKERS=4 31 | CMD [ "php", "-S", "[::]:8080", "-t", "/var/www/html" ] 32 | HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080" ] 33 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build Docker Image 2 | 3 | on: 4 | push: 5 | paths: 6 | - build.sh 7 | - .github/workflows/build.yml 8 | schedule: 9 | - cron: '5 3 * * *' 10 | workflow_dispatch: 11 | 12 | permissions: 13 | contents: read 14 | packages: write 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Clone 21 | uses: actions/checkout@v4 22 | 23 | - name: Set up QEMU 24 | uses: docker/setup-qemu-action@v3 25 | 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v3 28 | 29 | - name: Login into Github Docker Registery 30 | run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin 31 | 32 | - name: Login into Docker Hub 33 | run: echo "${{ secrets.DOCKER_HUB_PAT }}" | docker login -u shyim --password-stdin 34 | 35 | - name: Get latest Adminerevo version 36 | id: ADMINEREVO_VERSION 37 | run: | 38 | VERSION=$(curl https://api.github.com/repos/adminerevo/adminerevo/releases/latest | jq '.tag_name | ltrimstr("v")' -r) 39 | echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" 40 | 41 | - name: Build and push 42 | uses: docker/build-push-action@v5 43 | with: 44 | push: true 45 | tags: | 46 | ghcr.io/shyim/adminerevo:latest 47 | ghcr.io/shyim/adminerevo:${{ steps.ADMINEREVO_VERSION.outputs.VERSION }} 48 | shyim/adminerevo:latest 49 | shyim/adminerevo:${{ steps.ADMINEREVO_VERSION.outputs.VERSION }} 50 | platforms: linux/amd64,linux/arm64 51 | build-args: | 52 | ADMINEREVO_VERSION=${{ steps.ADMINEREVO_VERSION.outputs.VERSION }} 53 | -------------------------------------------------------------------------------- /rootfs/var/www/html/plugin-loader.php: -------------------------------------------------------------------------------- 1 | 1) { 38 | fwrite(STDERR, 'Unable to load plugin file "'.$name.'", because it defines multiple classes.'."\n"); 39 | exit(1); 40 | } 41 | 42 | // Check constructor. 43 | $class = $classes[0]; 44 | require($file); 45 | 46 | $constructor = (new \ReflectionClass($class))->getConstructor(); 47 | 48 | if ($constructor && $constructor->getNumberOfRequiredParameters() > 0) { 49 | $requiredParameters = array_slice($constructor->getParameters(), 0, $constructor->getNumberOfRequiredParameters()); 50 | 51 | fwrite(STDERR, 'Unable to load plugin file "'.$name.'", because it has required parameters: '.implode(', ', array_map(function ($item) { 52 | return $item->getName(); 53 | }, $requiredParameters))."\n". 54 | 'Create a file /var/www/html/plugins-custom/'.$name.'.php" with the following contents to load the plugin:'."\n\n". 55 | 'getDocComment().' 59 | return new '.$class.'( 60 | '.implode(",\n\t", array_map(function ($item) { 61 | return '$'.$item->getName()." = ".($item->isOptional() ? var_export($item->getDefaultValue(), true) : '???'); 62 | }, $constructor->getParameters())).' 63 | ); 64 | '); 65 | exit(1); 66 | } 67 | 68 | echo ' [!NOTE] 4 | > The official project of adminer is revived, use https://hub.docker.com/_/adminer instead 5 | 6 | ## What is Adminerevo? 7 | 8 | Adminerevo is a fork of Adminer, but it's better maintained and has more features. It's a full-featured database management tool written in PHP. Conversely, to phpMyAdmin, it consists of a single file ready to deploy to the target server. Adminer is available for MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch and MongoDB. 9 | 10 | > [adminerevo.org](https://docs.adminerevo.org/) 11 | 12 | ## How to use this image 13 | 14 | ### Standalone 15 | 16 | ```console 17 | $ docker run --link some_database:db -p 8080:8080 ghcr.io/shyim/adminerevo:latest 18 | ``` 19 | 20 | Then you can hit `http://localhost:8080` or `http://host-ip:8080` in your browser. 21 | 22 | ### ... via [`docker-compose`](https://github.com/docker/compose) or [`docker stack deploy`](https://docs.docker.com/engine/reference/commandline/stack_deploy/) 23 | 24 | Example `docker-compose.yml` for `adminerevo`: 25 | 26 | ```yaml 27 | # Use root/example as user/password credentials 28 | 29 | services: 30 | adminer: 31 | image: ghcr.io/shyim/adminerevo:latest 32 | restart: always 33 | ports: 34 | - 8080:8080 35 | db: 36 | image: mysql:8.0 37 | restart: always 38 | environment: 39 | MYSQL_ROOT_PASSWORD: example 40 | ``` 41 | 42 | ### Loading plugins 43 | 44 | This image bundles all official Adminerevo plugins. You can find the list of plugins on GitHub: https://github.com/adminerevo/adminerevo/tree/main/plugins. 45 | 46 | To load plugins you can pass a list of filenames in `ADMINER_PLUGINS`: 47 | 48 | ```console 49 | $ docker run --link some_database:db -p 8080:8080 -e ADMINER_PLUGINS='tables-filter tinymce' ghcr.io/shyim/adminerevo:latest 50 | ``` 51 | 52 | If a plugin *requires* parameters to work correctly instead of adding the plugin to `ADMINER_PLUGINS`, you need to add a custom file to the container: 53 | 54 | ```console 55 | $ docker run --link some_database:db -p 8080:8080 -e ADMINER_PLUGINS='login-servers' ghcr.io/shyim/adminerevo:latest 56 | Unable to load plugin file "login-servers", because it has required parameters: servers 57 | Create a file "/var/www/html/plugins-custom/login-servers.php" with the following contents to load the plugin: 58 | 59 | $description) or array($category => array()) 64 | * @param string 65 | */ 66 | return new AdminerLoginServers( 67 | $servers = ???, 68 | $driver = 'server' 69 | ); 70 | ``` 71 | 72 | To load a custom plugin you can add PHP scripts that return the instance of the plugin object to `/var/www/html/plugins-custom/`. 73 | 74 | ### Choosing a design 75 | 76 | The image bundles all the designs that are available in the Adminer source package. You can find the list of designs on GitHub: https://github.com/adminerevo/adminerevo/tree/main/designs. 77 | 78 | To use a bundled design you can pass its name in `ADMINER_DESIGN`: 79 | 80 | ```console 81 | $ docker run --link some_database:db -p 8080:8080 -e ADMINER_DESIGN='nette' ghcr.io/shyim/adminerevo:latest 82 | ``` 83 | 84 | To use a custom design you can add a file called `/var/www/html/adminer.css`. 85 | 86 | ### Usage with external server 87 | 88 | You can specify the default host with the `ADMINER_DEFAULT_SERVER` environment variable. This is useful if you are connecting to an external server or a docker container named something other than the default `db`. 89 | 90 | ```console 91 | docker run -p 8080:8080 -e ADMINER_DEFAULT_SERVER=mysql ghcr.io/shyim/adminerevo:latest 92 | ``` 93 | 94 | ### Setting default login credentials 95 | 96 | You can set the following environment variables to configure the login screen: 97 | 98 | | Environment Variable | Description | 99 | | -------------------- | ----------- | 100 | | `ADMINER_DEFAULT_DRIVER` | default connection driver | 101 | | `ADMINER_DEFAULT_SERVER` | default connection host | 102 | | `ADMINER_DEFAULT_USER` | default connection user | 103 | | `ADMINER_DEFAULT_PASSWORD` | default connection password | 104 | | `ADMINER_DEFAULT_DB` | default connection database | 105 | 106 | The supported driver values are: 107 | 108 | | Value | Driver | 109 | | ----- | ------ | 110 | | `server` | MySQL | 111 | | `sqlite` | SQLite 3 | 112 | | `sqlite2` | SQLite 2 | 113 | | `pgsql` | PostgreSQL | 114 | | `oracle` | Oracle (beta) | 115 | | `mssql` | MS SQL (beta) | 116 | | `mongo` | MongoDB (beta) | 117 | | `elastic` | Elasticsearch (beta) | 118 | 119 | ## Supported Drivers 120 | 121 | While Adminer supports a wide range of database drivers this image only supports the following out of the box: 122 | 123 | - MySQL 124 | - PostgreSQL 125 | - SQLite 126 | - Elasticsearch 127 | 128 | # License 129 | 130 | View [license information](https://github.com/adminerevo/adminerevo/blob/main/LICENSE) for the software contained in this image. 131 | --------------------------------------------------------------------------------