Skip to content

Commit b9e113f

Browse files
committed
Add SBOMs to the image
1 parent fb71fb1 commit b9e113f

File tree

2 files changed

+67
-4
lines changed

2 files changed

+67
-4
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ docker-build:
99
docker build ./docker \
1010
--build-arg VCS_REF=`git rev-parse HEAD` \
1111
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
12+
--build-arg RUST_PYTHON_VERSION=`docker run -q --rm dclong/rustpython:alpine --version | cut -d ' ' -f 2` \
1213
--tag $(IMAGE_TAG) \
1314
--pull
1415

docker/Dockerfile

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# syntax=docker/dockerfile:1
12
FROM alpine:3.17
23

34
ARG VERSION="1.2.6.5"
45
ARG DIST_URL="https://github.com/leenooks/phpLDAPadmin/archive/refs/tags/${VERSION}.tar.gz"
56
ARG BUILD_DATE
67
ARG VCS_REF
8+
ARG RUST_PYTHON_VERSION
79

810
# Set user and group
911
ARG user=deploy
@@ -14,6 +16,25 @@ ENV FIRST_START_DONE="/container/first-start-done"
1416

1517
COPY --from=dclong/rustpython:alpine /usr/local/bin/rustpython /usr/local/bin/rustpython
1618

19+
COPY <<-EOT /usr/local/share/sbom/rustpython.spdx.json
20+
{
21+
"spdxVersion": "SPDX-2.3",
22+
"dataLicense": "CC0-1.0",
23+
"SPDXID": "SPDXRef-DOCUMENT",
24+
"name": "docker-rustpython",
25+
"packages": [
26+
{
27+
"name": "rustpython",
28+
"SPDXID": "SPDXRef-Package-binary-rustpython-${RUST_PYTHON_VERSION}",
29+
"versionInfo": "${RUST_PYTHON_VERSION}",
30+
"downloadLocation": "https://hub.docker.com/r/dclong/rustpython",
31+
"sourceInfo": "copied from dclong/rustpython:alpine Docker image",
32+
"description": "rustpython"
33+
}
34+
]
35+
}
36+
EOT
37+
1738
RUN apk add --no-cache --update nginx curl bash musl \
1839
openssl libgcc \
1940
php81-fpm php81 php81-session \
@@ -47,6 +68,7 @@ COPY nginx.conf /etc/nginx/nginx.conf
4768
COPY php-fpm-www-pool.conf /etc/php81/php-fpm.d/www.conf
4869
COPY --chown=deploy:deploy config.php ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/config/config.php
4970

71+
5072
# Switch to user
5173
USER deploy:deploy
5274

@@ -56,28 +78,68 @@ RUN curl -# -L -o phpldapadmin.tar.gz ${DIST_URL} && \
5678
rm -vr ./doc/ ./.gitignore ./*.md && \
5779
php -l lib/functions.php
5880

81+
COPY <<-EOT /usr/local/share/sbom/phpldapadmin.spdx.json
82+
{
83+
"spdxVersion": "SPDX-2.3",
84+
"dataLicense": "CC0-1.0",
85+
"SPDXID": "SPDXRef-DOCUMENT",
86+
"name": "docker-phpldapadmin",
87+
"packages": [
88+
{
89+
"name": "phpldapadmin",
90+
"SPDXID": "SPDXRef-Package-phpldapadmin",
91+
"versionInfo": "${VERSION}",
92+
"originator": "Person: Deon George",
93+
"downloadLocation": "${DIST_URL}",
94+
"sourceInfo": "dowloaded from GitHub releases",
95+
"licenseConcluded": "GPL-2.0-or-later",
96+
"licenseDeclared": "GPL-2.0-or-later",
97+
"copyrightText": "NOASSERTION",
98+
"description": "phpLDAPadmin"
99+
}
100+
],
101+
"externalRefs": [
102+
{
103+
"referenceCategory": "SECURITY",
104+
"referenceLocator": "cpe:2.3:a:phpldapadmin_project:phpldapadmin",
105+
"referenceType": "cpe23Type"
106+
},
107+
{
108+
"referenceCategory": "SECURITY",
109+
"referenceLocator": "cpe:/a:phpldapadmin_project:phpldapadmin",
110+
"referenceType": "cpe22Type"
111+
},
112+
{
113+
"referenceCategory": "PACKAGE_MANAGER",
114+
"referenceLocator": "pkg:deb/debian/phpldapadmin",
115+
"referenceType": "purl"
116+
}
117+
]
118+
}
119+
EOT
120+
59121
# Metadata
60122
LABEL org.label-schema.vendor="Sudo-Bot" \
61123
org.label-schema.url="https://github.com/sudo-bot/docker-phpldapadmin#readme" \
62124
org.label-schema.name="docker-phpldapadmin" \
63-
org.label-schema.description="A phpldapadmin image" \
64-
org.label-schema.version=${RELEASE_VERSION} \
125+
org.label-schema.description="A phpLDAPadmin image" \
126+
org.label-schema.version=${VERSION} \
65127
org.label-schema.vcs-url="https://github.com/sudo-bot/docker-phpldapadmin.git" \
66128
org.label-schema.vcs-ref=${VCS_REF} \
67129
org.label-schema.build-date=${BUILD_DATE} \
68130
org.label-schema.docker.schema-version="1.0" \
69131
\
70132
com.docker.extension.publisher-url="https://github.com/sudo-bot" \
71133
\
72-
org.opencontainers.image.title="Docker phpldapadmin server" \
134+
org.opencontainers.image.title="Docker phpLDAPadmin server" \
73135
org.opencontainers.image.authors="[email protected]" \
74136
org.opencontainers.image.url="https://github.com/sudo-bot/docker-phpldapadmin#readme" \
75137
org.opencontainers.image.documentation="https://github.com/sudo-bot/docker-phpldapadmin#readme" \
76138
org.opencontainers.image.source="https://github.com/sudo-bot/docker-phpldapadmin" \
77139
org.opencontainers.image.vendor="Sudo-Bot" \
78140
org.opencontainers.image.licenses="MPL-2.0" \
79141
org.opencontainers.image.created=${BUILD_DATE} \
80-
org.opencontainers.image.version=${RELEASE_VERSION} \
142+
org.opencontainers.image.version=${VERSION} \
81143
org.opencontainers.image.revision=${VCS_REF} \
82144
org.opencontainers.image.ref.name="${VERSION}"
83145

0 commit comments

Comments
 (0)