Skip to content

Commit 508cb59

Browse files
authored
Fix: [AEA-0000] - add version number to docker image (#10)
## Summary - Routine Change ### Details - add version number to dockerfile
1 parent df7c102 commit 508cb59

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.github/workflows/docker_image_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Build cdk-utils-build Docker image
2727
id: build-cdk-utils-build-image
2828
run: |
29-
docker build -t "cdk-utils-build:${{ inputs.VERSION_NUMBER }}" -f docker/Dockerfile .
29+
docker build -t "cdk-utils-build:${{ inputs.VERSION_NUMBER }}" -f docker/Dockerfile --build-arg VERSION=${{ inputs.VERSION_NUMBER }} .
3030
docker save "cdk-utils-build:${{ inputs.VERSION_NUMBER }}" -o cdk-utils-build.img
3131
3232
- uses: actions/upload-artifact@v4

docker/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
FROM ubuntu:24.04
2+
3+
ARG VERSION
4+
25
RUN apt-get update \
36
&& export DEBIAN_FRONTEND=noninteractive \
47
&& apt-get -y upgrade
@@ -33,4 +36,6 @@ RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
3336
# copy files needed for deployment
3437
COPY --chown=cdkuser docker/entrypoint.sh /home/cdkuser/
3538

39+
RUN echo "${VERSION}" > version.txt
40+
3641
ENTRYPOINT ["/home/cdkuser/entrypoint.sh"]

docker/entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
VERSION=$(cat version.txt)
5+
6+
echo "**************************************"
7+
echo "RUNNING CDK_UTILS VERSION ${VERSION}"
8+
echo "**************************************"
9+
echo
10+
echo
11+
412
if [ -z "${CDK_APP_PATH}" ]; then
513
echo "CDK_APP_PATH is unset or set to the empty string"
614
exit 1

0 commit comments

Comments
 (0)