Skip to content

Commit cb255aa

Browse files
committed
build(deps): switch to Docker hardened image
1 parent 758662b commit cb255aa

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/docker-build-push.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ jobs:
6363
with:
6464
username: ${{ secrets.DOCKERHUB_USERNAME }}
6565
password: ${{ secrets.DOCKERHUB_TOKEN }}
66+
- uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
67+
if: github.ref == 'refs/heads/main'
68+
with:
69+
registry: dhi.io
70+
username: ${{ secrets.DOCKERHUB_USERNAME }}
71+
password: ${{ secrets.DOCKERHUB_TOKEN }}
6672
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
6773
id: build
6874
with:
@@ -98,7 +104,7 @@ jobs:
98104
run: |
99105
set -euo pipefail
100106
IFS=$'\n\t'
101-
VERSION="$(\grep "${IMAGE}/Dockerfile" -e '^FROM' | \head -n 1 | \sed -e 's/@.*$//; s/^.*://;')"
107+
VERSION="$(\grep "${IMAGE}/Dockerfile" -e '^FROM' | \head -n 1 | \sed -e 's/@.*$//; s/^.*://; s/-.*$//;')"
102108
if [[ "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
103109
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
104110
fi

.github/workflows/docker-release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ jobs:
5454
with:
5555
username: ${{ secrets.DOCKERHUB_USERNAME }}
5656
password: ${{ secrets.DOCKERHUB_TOKEN }}
57+
- uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
58+
if: github.ref == 'refs/heads/main'
59+
with:
60+
registry: dhi.io
61+
username: ${{ secrets.DOCKERHUB_USERNAME }}
62+
password: ${{ secrets.DOCKERHUB_TOKEN }}
5763
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
5864
id: build
5965
with:

maven-check-versions/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM maven:3.9.12@sha256:800a33a4cb190082c47abcd57944c852e1dece834f92c0aef65bea6336c52a72
1+
FROM dhi.io/maven:3.9.12-jdk25-debian13-dev@sha256:0a9d6751a403be81eeaed3b7107007d8f4d3e67bb251556f757857292cf78797
22

33
HEALTHCHECK NONE
44

@@ -19,7 +19,7 @@ RUN mkdir -m 777 /opt/maven
1919
ARG MAVEN_USER_HOME="/opt/maven/.m2"
2020
ENV MAVEN_USER_HOME="${MAVEN_USER_HOME}"
2121

22-
USER ubuntu
22+
USER nonroot
2323

2424
WORKDIR /opt/project
2525

0 commit comments

Comments
 (0)