Skip to content

Commit 9ad9416

Browse files
[PRM-227] Updated Container Image OS versions to latest version of Alpine (#278)
* [PRM-227] upgraded Alpine to 3.23 and Node to 24 * [PRM-227] Upgraded all OS images to latest Alpine * [PRM-227] Added apk upgrade to each Docker File * [PRM-227] Replaced aws-cli pip3 install with APK install * [PRM-227] removed aws-helpers * [PRM-227] Added SBOM scanning for images after push to ECR * [PRM-227] Fixed typo in Dockerfile
1 parent 30283b9 commit 9ad9416

17 files changed

Lines changed: 166 additions & 262 deletions

File tree

.github/workflows/base-java-service-jobs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,24 @@ jobs:
116116
set -euo pipefail
117117
docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
118118
119+
- name: Generate SBOM for Docker Image
120+
uses: anchore/sbom-action@v0
121+
if: ${{ inputs.environment == 'development' }}
122+
with:
123+
image: ${{ steps.ecr-login.outputs.registry }}/${{ inputs.image_prefix }}${{ inputs.service }}:${{ github.sha }}
124+
format: cyclonedx-json
125+
output-file: sbom-image-${{ github.event.repository.name }}--${{ github.sha }}.cdx.json
126+
127+
- name: Scan SBOM for Docker Image
128+
uses: anchore/scan-action@v7
129+
if: ${{ inputs.environment == 'development' }}
130+
with:
131+
sbom: sbom-image-${{ github.event.repository.name }}--${{ github.sha }}.cdx.json
132+
fail-build: true
133+
severity-cutoff: low
134+
only-fixed: true
135+
output-format: table
136+
119137
deploy_infra:
120138
name: Deploy Infrastructure
121139
needs: [build_and_publish]

.github/workflows/base-node-service-jobs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,24 @@ jobs:
148148
set -euo pipefail
149149
docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
150150
151+
- name: Generate SBOM for Docker Image
152+
uses: anchore/sbom-action@v0
153+
if: ${{ inputs.environment == 'development' }}
154+
with:
155+
image: ${{ steps.ecr-login.outputs.registry }}/deductions/${{ inputs.service }}:${{ github.sha }}
156+
format: cyclonedx-json
157+
output-file: sbom-image-${{ github.event.repository.name }}--${{ github.sha }}.cdx.json
158+
159+
- name: Scan SBOM for Docker Image
160+
uses: anchore/scan-action@v7
161+
if: ${{ inputs.environment == 'development' }}
162+
with:
163+
sbom: sbom-image-${{ github.event.repository.name }}--${{ github.sha }}.cdx.json
164+
fail-build: true
165+
severity-cutoff: low
166+
only-fixed: true
167+
output-format: table
168+
151169
deploy_infra:
152170
name: Deploy Infrastructure
153171
needs: [build_and_publish]

.github/workflows/base-python-service-jobs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ jobs:
9898
run: |
9999
docker push "$ECR_URI:$IMAGE_TAG"
100100
101+
- name: Generate SBOM for Docker Image
102+
uses: anchore/sbom-action@v0
103+
if: ${{ inputs.environment == 'development' }}
104+
with:
105+
image: ${{ steps.ecr-repo.outputs.uri }}:${{ github.sha }}
106+
format: cyclonedx-json
107+
output-file: sbom-image-${{ github.event.repository.name }}--${{ github.sha }}.cdx.json
108+
109+
- name: Scan SBOM for Docker Image
110+
uses: anchore/scan-action@v7
111+
if: ${{ inputs.environment == 'development' }}
112+
with:
113+
sbom: sbom-image-${{ github.event.repository.name }}--${{ github.sha }}.cdx.json
114+
fail-build: true
115+
severity-cutoff: low
116+
only-fixed: true
117+
output-format: table
118+
101119
deploy_infra:
102120
if: ${{ inputs.deploy_infra && inputs.is_deployment }}
103121
name: Deploy Infrastructure

services/ehr-out-service/Dockerfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM node:22.5-alpine AS builder
1+
FROM node:24-alpine3.23 AS builder
2+
3+
RUN apk update && \
4+
apk -u list && \
5+
apk upgrade && \
6+
rm -rf /var/cache/apk/*
27

38
COPY package*.json /app/
49

@@ -7,7 +12,7 @@ WORKDIR /app
712
RUN npm ci --omit=dev
813

914
# production app image
10-
FROM alpine:3.15
15+
FROM alpine:3.23
1116

1217
# take just node without npm (including npx) or yarn
1318
COPY --from=builder /usr/local/bin/node /usr/local/bin
@@ -16,16 +21,9 @@ COPY --from=builder /usr/local/bin/node /usr/local/bin
1621
COPY --from=builder /app /app
1722

1823
RUN apk update && \
19-
apk add --no-cache bash tini && \
24+
apk add --no-cache bash tini aws-cli && \
2025
rm -rf /var/cache/apk/*
2126

22-
RUN apk add --no-cache \
23-
python3 \
24-
py3-pip \
25-
&& pip3 install --upgrade pip \
26-
&& pip3 install \
27-
awscli \
28-
&& rm -rf /var/cache/apk/*
2927

3028
COPY build/ /app/build
3129

services/ehr-out-service/package-lock.json

Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)