Skip to content

Commit 00c7477

Browse files
authored
Merge pull request #41 from linuxserver/3.21
2 parents 807349c + c931d11 commit 00c7477

9 files changed

Lines changed: 113 additions & 43 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,30 @@ jobs:
4848
--header "Accept: application/vnd.oci.image.index.v1+json" \
4949
--header "Authorization: Bearer ${token}" \
5050
"https://ghcr.io/v2/${image}/manifests/${tag}")
51-
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
52-
digest=$(curl -s \
53-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
54-
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
55-
--header "Authorization: Bearer ${token}" \
56-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
57-
| jq -r '.config.digest')
51+
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
52+
# If there's a layer element it's a single-arch manifest so just get that digest
53+
digest=$(jq -r '.config.digest' <<< "${multidigest}")
54+
else
55+
# Otherwise it's multi-arch or has manifest annotations
56+
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
57+
# Check for manifest annotations and delete if found
58+
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
59+
fi
60+
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
61+
# If there's still more than one digest, it's multi-arch
62+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
63+
else
64+
# Otherwise it's single arch
65+
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
66+
fi
67+
if digest=$(curl -s \
68+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
69+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
70+
--header "Authorization: Bearer ${token}" \
71+
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
72+
digest=$(jq -r '.config.digest' <<< "${digest}");
73+
fi
74+
fi
5875
image_info=$(curl -sL \
5976
--header "Authorization: Bearer ${token}" \
6077
"https://ghcr.io/v2/${image}/blobs/${digest}")
@@ -92,7 +109,7 @@ jobs:
92109
else
93110
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
94111
echo "New version \`${EXT_RELEASE}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
95-
if "${artifacts_found}" == "true" ]]; then
112+
if [[ "${artifacts_found}" == "true" ]]; then
96113
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
97114
fi
98115
response=$(curl -iX POST \

.github/workflows/package_trigger_scheduler.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,26 @@ jobs:
2727
fi
2828
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
2929
JENKINS_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-phpmyadmin/${br}/jenkins-vars.yml)
30-
if [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
30+
if ! curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-phpmyadmin/${br}/Jenkinsfile >/dev/null 2>&1; then
31+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
32+
echo "> No Jenkinsfile found. Branch is either deprecated or is an early dev branch." >> $GITHUB_STEP_SUMMARY
33+
skipped_branches="${skipped_branches}${br} "
34+
elif [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
3135
echo "Branch appears to be live; checking workflow." >> $GITHUB_STEP_SUMMARY
32-
if [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
36+
README_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-phpmyadmin/${br}/readme-vars.yml)
37+
if [[ $(yq -r '.project_deprecation_status' <<< "${README_VARS}") == "true" ]]; then
38+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
39+
echo "> Branch appears to be deprecated; skipping trigger." >> $GITHUB_STEP_SUMMARY
40+
skipped_branches="${skipped_branches}${br} "
41+
elif [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
3342
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3443
echo "> Skipping branch ${br} due to \`skip_package_check\` being set in \`jenkins-vars.yml\`." >> $GITHUB_STEP_SUMMARY
3544
skipped_branches="${skipped_branches}${br} "
3645
elif grep -q "^phpmyadmin_${br}" <<< "${SKIP_PACKAGE_TRIGGER}"; then
3746
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3847
echo "> Github organizational variable \`SKIP_PACKAGE_TRIGGER\` contains \`phpmyadmin_${br}\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
3948
skipped_branches="${skipped_branches}${br} "
40-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-phpmyadmin/job/${br}/lastBuild/api/json | jq -r '.building') == "true" ]; then
49+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-phpmyadmin/job/${br}/lastBuild/api/json | jq -r '.building' 2>/dev/null) == "true" ]; then
4150
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
4251
echo "> There already seems to be an active build on Jenkins; skipping package trigger for ${br}" >> $GITHUB_STEP_SUMMARY
4352
skipped_branches="${skipped_branches}${br} "
@@ -49,18 +58,26 @@ jobs:
4958
response=$(curl -iX POST \
5059
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-phpmyadmin/job/${br}/buildWithParameters?PACKAGE_CHECK=true \
5160
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
61+
if [[ -z "${response}" ]]; then
62+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
63+
echo "> Jenkins build could not be triggered. Skipping branch."
64+
continue
65+
fi
5266
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
5367
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
5468
sleep 10
5569
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
5670
buildurl="${buildurl%$'\r'}"
5771
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
5872
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
59-
curl -iX POST \
73+
if ! curl -ifX POST \
6074
"${buildurl}submitDescription" \
6175
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
6276
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
63-
--data-urlencode "Submit=Submit"
77+
--data-urlencode "Submit=Submit"; then
78+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
79+
echo "> Unable to change the Jenkins job description."
80+
fi
6481
sleep 20
6582
fi
6683
else

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.20
3+
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.21
44

55
# set version label
66
ARG BUILD_DATE
@@ -11,9 +11,9 @@ LABEL maintainer="thespad"
1111

1212
# environment settings
1313
ARG PHPMYADMIN_RELEASE_GPG_KEY="3D06A59ECE730EB71B511C17CE752F178259BD92"
14-
ENV MAX_EXECUTION_TIME 600
15-
ENV MEMORY_LIMIT 512M
16-
ENV UPLOAD_LIMIT 8192K
14+
ENV MAX_EXECUTION_TIME=600
15+
ENV MEMORY_LIMIT=512M
16+
ENV UPLOAD_LIMIT=8192K
1717

1818
RUN \
1919
apk add --no-cache --virtual=build-dependencies \

Dockerfile.aarch64

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.20
3+
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.21
44

55
# set version label
66
ARG BUILD_DATE
@@ -11,9 +11,9 @@ LABEL maintainer="thespad"
1111

1212
# environment settings
1313
ARG PHPMYADMIN_RELEASE_GPG_KEY="3D06A59ECE730EB71B511C17CE752F178259BD92"
14-
ENV MAX_EXECUTION_TIME 600
15-
ENV MEMORY_LIMIT 512M
16-
ENV UPLOAD_LIMIT 8192K
14+
ENV MAX_EXECUTION_TIME=600
15+
ENV MEMORY_LIMIT=512M
16+
ENV UPLOAD_LIMIT=8192K
1717

1818
RUN \
1919
apk add --no-cache --virtual=build-dependencies \

Jenkinsfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ pipeline {
578578
--label \"org.opencontainers.image.title=Phpmyadmin\" \
579579
--label \"org.opencontainers.image.description=[Phpmyadmin](https://github.com/phpmyadmin/phpmyadmin/) is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. \" \
580580
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
581-
--provenance=false --sbom=false --builder=container --load \
581+
--provenance=true --sbom=true --builder=container --load \
582582
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
583583
sh '''#! /bin/bash
584584
set -e
@@ -607,7 +607,9 @@ pipeline {
607607
for i in "${CACHE[@]}"; do
608608
docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} &
609609
done
610-
wait
610+
for p in $(jobs -p); do
611+
wait "$p" || { echo "job $p failed" >&2; exit 1; }
612+
done
611613
fi
612614
'''
613615
}
@@ -642,7 +644,7 @@ pipeline {
642644
--label \"org.opencontainers.image.title=Phpmyadmin\" \
643645
--label \"org.opencontainers.image.description=[Phpmyadmin](https://github.com/phpmyadmin/phpmyadmin/) is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. \" \
644646
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
645-
--provenance=false --sbom=false --builder=container --load \
647+
--provenance=true --sbom=true --builder=container --load \
646648
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
647649
sh '''#! /bin/bash
648650
set -e
@@ -671,7 +673,9 @@ pipeline {
671673
for i in "${CACHE[@]}"; do
672674
docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} &
673675
done
674-
wait
676+
for p in $(jobs -p); do
677+
wait "$p" || { echo "job $p failed" >&2; exit 1; }
678+
done
675679
fi
676680
'''
677681
}
@@ -699,7 +703,7 @@ pipeline {
699703
--label \"org.opencontainers.image.title=Phpmyadmin\" \
700704
--label \"org.opencontainers.image.description=[Phpmyadmin](https://github.com/phpmyadmin/phpmyadmin/) is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. \" \
701705
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
702-
--provenance=false --sbom=false --builder=container --load \
706+
--provenance=true --sbom=true --builder=container --load \
703707
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
704708
sh '''#! /bin/bash
705709
set -e
@@ -728,7 +732,9 @@ pipeline {
728732
for i in "${CACHE[@]}"; do
729733
docker push ${i}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} &
730734
done
731-
wait
735+
for p in $(jobs -p); do
736+
wait "$p" || { echo "job $p failed" >&2; exit 1; }
737+
done
732738
fi
733739
'''
734740
}

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ We support all of the official [environment variables](https://docs.phpmyadmin.n
6565

6666
For more information check out the [phpmyadmin documentation](https://www.phpmyadmin.net/docs/).
6767

68+
## Read-Only Operation
69+
70+
This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/).
71+
72+
### Caveats
73+
74+
* Custom themes are not supported
75+
76+
## Non-Root Operation
77+
78+
This image can be run with a non-root user. For details please [read the docs](https://docs.linuxserver.io/misc/non-root/).
79+
80+
### Caveats
81+
82+
* `/tmp` must be mounted to tmpfs
83+
* Custom themes are not supported
84+
6885
## Usage
6986

7087
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
@@ -122,6 +139,8 @@ Containers are configured using parameters passed at runtime (such as those abov
122139
| `-e PMA_ARBITRARY=1` | Set to `1` to allow you to connect to any server. Setting to `0` will only allow you to connect to specified hosts (See Application Setup) |
123140
| `-e PMA_ABSOLUTE_URI=https://phpmyadmin.example.com` | Set the URL you will use to access the web frontend |
124141
| `-v /config` | Persistent config files |
142+
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
143+
| `--user=1000:1000` | Run container with a non-root user. Please [read the docs](https://docs.linuxserver.io/misc/non-root/). |
125144

126145
## Environment variables from files (Docker secrets)
127146

@@ -285,6 +304,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
285304

286305
## Versions
287306

307+
* **19.12.24:** - Rebase to Alpine 3.21.
288308
* **27.05.24:** - Existing users should update their nginx confs to avoid http2 deprecation warnings.
289309
* **24.05.24:** - Rebase to Alpine 3.20.
290310
* **28.12.23:** - Rebase to Alpine 3.19 with php 8.3.

readme-vars.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ param_usage_include_vols: true
2626
param_volumes:
2727
- {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Persistent config files"}
2828
# application setup block
29+
readonly_supported: true
30+
readonly_message: |
31+
* Custom themes are not supported
32+
nonroot_supported: true
33+
nonroot_message: |
34+
* `/tmp` must be mounted to tmpfs
35+
* Custom themes are not supported
2936
app_setup_block_enabled: true
3037
app_setup_block: |
3138
This image uses nginx, in contrast to the official images which offer fpm-only or Apache variants.
@@ -90,6 +97,7 @@ init_diagram: |
9097
"phpmyadmin:latest" <- Base Images
9198
# changelog
9299
changelogs:
100+
- {date: "19.12.24:", desc: "Rebase to Alpine 3.21."}
93101
- {date: "27.05.24:", desc: "Existing users should update their nginx confs to avoid http2 deprecation warnings."}
94102
- {date: "24.05.24:", desc: "Rebase to Alpine 3.20."}
95103
- {date: "28.12.23:", desc: "Rebase to Alpine 3.19 with php 8.3."}

root/defaults/config.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
/* Uploads setup */
140140
$cfg['UploadDir'] = '';
141141
$cfg['SaveDir'] = '';
142+
$cfg['TempDir'] = '/tmp';
142143

143144
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
144145
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];

root/etc/s6-overlay/s6-rc.d/init-phpmyadmin-config/run

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# shellcheck shell=bash
33

44
mkdir -p \
5-
/config/phpmyadmin \
6-
/app/www/public/tmp
5+
/config/phpmyadmin
76

87
if [[ ! -f /config/phpmyadmin/config.secret.inc.php ]]; then
98
cat >/config/phpmyadmin/config.secret.inc.php <<EOT
@@ -28,19 +27,21 @@ if [[ ! -f /config/phpmyadmin/config.inc.php ]]; then
2827
cp /defaults/config.inc.php /config/phpmyadmin/config.inc.php
2928
fi
3029

31-
# Set up themes
32-
if [[ -d "/config/themes" && ! -L "/app/www/public/themes" ]]; then
33-
cp -R /app/www/public/themes/* /config/themes
34-
rm -rf "/app/www/public/themes"
35-
fi
36-
if [[ ! -d "/config/themes" && ! -L "/app/www/public/themes" ]]; then
37-
mv "/app/www/public/themes" /config/themes
38-
fi
39-
if [[ -d "/config/themes" && ! -L "/app/www/public/themes" ]]; then
40-
ln -s "/config/themes" "/app/www/public/themes"
30+
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
31+
# Set up themes
32+
if [[ -d "/config/themes" && ! -L "/app/www/public/themes" ]]; then
33+
cp -R /app/www/public/themes/* /config/themes
34+
rm -rf "/app/www/public/themes"
35+
fi
36+
if [[ ! -d "/config/themes" && ! -L "/app/www/public/themes" ]]; then
37+
mv "/app/www/public/themes" /config/themes
38+
fi
39+
if [[ -d "/config/themes" && ! -L "/app/www/public/themes" ]]; then
40+
ln -s "/config/themes" "/app/www/public/themes"
41+
fi
4142
fi
4243

43-
# permissions
44-
lsiown -R abc:abc \
45-
/config \
46-
/app/www/public/tmp
44+
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
45+
lsiown -R abc:abc \
46+
/config
47+
fi

0 commit comments

Comments
 (0)