Cleanup according to review

This commit is contained in:
J0WI
2020-05-07 01:11:27 +02:00
parent 48f16c0dde
commit 12d40a0300
11 changed files with 21 additions and 115 deletions
+5 -5
View File
@@ -29,7 +29,7 @@ _helpers:
stage: "Run tests in testing container"
script:
# Build image
- docker build --build-arg VCS_REF=`git rev-parse HEAD` --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -t phpmyadmin/phpmyadmin apache
- docker build -t phpmyadmin/phpmyadmin apache
# Test for single database
- docker run --name testadmin -d --link db_server:db -p 9090:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh testadmin 9090
@@ -71,20 +71,20 @@ jobs:
name: "Apache amd64"
arch: amd64
script:
- docker build --build-arg VCS_REF=`git rev-parse HEAD` --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -t phpmyadmin/phpmyadmin apache
- docker build -t phpmyadmin/phpmyadmin apache
- <<: *build-image
name: "fpm amd64"
arch: amd64
script:
- docker build --build-arg VCS_REF=`git rev-parse HEAD` --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -t phpmyadmin/phpmyadmin fpm
- docker build -t phpmyadmin/phpmyadmin fpm
- <<: *build-image
name: "fpm-alpine amd64"
arch: amd64
script:
- docker build --build-arg VCS_REF=`git rev-parse HEAD` --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -t phpmyadmin/phpmyadmin fpm-alpine
- docker build -t phpmyadmin/phpmyadmin fpm-alpine
- <<: *test-apache-image
name: "Run testing for MariaDB"
env: DB=mariadb:latest
- <<: *test-apache-image
name: "Run testing for MySQL"
env: DB=mysql:latest
env: DB=mysql:latest
+2 -9
View File
@@ -62,11 +62,8 @@ RUN set -ex; \
# Calculate download URL
ENV VERSION %%VERSION%%
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.title="Official phpMyAdmin Docker image" \
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
@@ -74,9 +71,7 @@ LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.created="${BUILD_DATE}"
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
@@ -101,8 +96,6 @@ RUN set -ex; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -rf /var/www/html/setup/ /var/www/html/examples/ /var/www/html/test/ /var/www/html/po/ /var/www/html/composer.json /var/www/html/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
apk del --no-network .fetch-deps
# Copy configuration
+2 -8
View File
@@ -64,11 +64,8 @@ RUN set -ex; \
# Calculate download URL
ENV VERSION %%VERSION%%
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.title="Official phpMyAdmin Docker image" \
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
@@ -76,9 +73,7 @@ LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.created="${BUILD_DATE}"
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
@@ -108,7 +103,6 @@ RUN set -ex; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -rf /var/www/html/setup/ /var/www/html/examples/ /var/www/html/test/ /var/www/html/po/ /var/www/html/composer.json /var/www/html/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
+2 -8
View File
@@ -64,11 +64,8 @@ RUN set -ex; \
# Calculate download URL
ENV VERSION 5.0.2
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.title="Official phpMyAdmin Docker image" \
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
@@ -76,9 +73,7 @@ LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.created="${BUILD_DATE}"
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
@@ -108,7 +103,6 @@ RUN set -ex; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -rf /var/www/html/setup/ /var/www/html/examples/ /var/www/html/test/ /var/www/html/po/ /var/www/html/composer.json /var/www/html/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
+1 -16
View File
@@ -1,20 +1,5 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
@@ -49,7 +34,7 @@ if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
function get_docker_secret() {
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
+1 -16
View File
@@ -1,20 +1,5 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
@@ -49,7 +34,7 @@ if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
function get_docker_secret() {
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
+2 -9
View File
@@ -62,11 +62,8 @@ RUN set -ex; \
# Calculate download URL
ENV VERSION 5.0.2
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.title="Official phpMyAdmin Docker image" \
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
@@ -74,9 +71,7 @@ LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.created="${BUILD_DATE}"
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
@@ -101,8 +96,6 @@ RUN set -ex; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -rf /var/www/html/setup/ /var/www/html/examples/ /var/www/html/test/ /var/www/html/po/ /var/www/html/composer.json /var/www/html/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
apk del --no-network .fetch-deps
# Copy configuration
+1 -16
View File
@@ -1,20 +1,5 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
@@ -49,7 +34,7 @@ if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
function get_docker_secret() {
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
+2 -8
View File
@@ -64,11 +64,8 @@ RUN set -ex; \
# Calculate download URL
ENV VERSION 5.0.2
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.title="Official phpMyAdmin Docker image" \
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
@@ -76,9 +73,7 @@ LABEL maintainer="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.created="${BUILD_DATE}"
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
@@ -108,7 +103,6 @@ RUN set -ex; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -rf /var/www/html/setup/ /var/www/html/examples/ /var/www/html/test/ /var/www/html/po/ /var/www/html/composer.json /var/www/html/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
+1 -16
View File
@@ -1,20 +1,5 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
@@ -49,7 +34,7 @@ if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
function get_docker_secret() {
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
+2 -4
View File
@@ -1,6 +1,4 @@
#!/bin/bash
#!/bin/sh
# This file is used by docker hub to build the image
docker build --build-arg VCS_REF=`git rev-parse HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-t $IMAGE_NAME .
docker build -t $IMAGE_NAME .