Commit 9412252 1 parent 5445278 commit 9412252 Copy full SHA for 9412252
File tree 3 files changed +13
-5
lines changed
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ LABEL org.opencontainers.image.vendor NSA Laboratory for Advanced Cybersecurity
3
3
LABEL org.opencontainers.image.source https://github.com/nsacyber/hirs
4
4
LABEL org.opencontainers.image.description NSA\'s HIRS Attestation Certificate Authority. Expose port 8443 to access the portal from outside the container.
5
5
6
+ # REF can be specified as a docker run environment variable to select the HIRS branch to work with
7
+ ENV REF=main
8
+
6
9
SHELL ["/bin/bash", "-c"]
7
10
8
11
# Rocky 9 has a different channel for some apps
@@ -50,7 +53,7 @@ RUN echo "#!/bin/bash" > /tmp/tpm_config && \
50
53
EXPOSE 8443
51
54
52
55
# Checkout HIRS
53
- RUN git clone -b main https://github.com/nsacyber/HIRS.git /repo
56
+ RUN git clone -b ${REF} https://github.com/nsacyber/HIRS.git /repo
54
57
55
58
# Defensive copy of the repo so it's easy to start fresh if needed
56
59
RUN mkdir /hirs
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ LABEL org.opencontainers.image.source https://github.com/nsacyber/hirs
9
9
LABEL org.opencontainers.image.description NSA\'s HIRS Attestation Certificate Authority in a Windows-native image. Expose port 8443 to access the portal from outside the container.
10
10
LABEL org.opencontainers.image.base.name mcr.microsoft.com/powershell:${BASE_IMAGE_TAG}
11
11
12
+ # REF can be specified as a docker run environment variable to select the HIRS branch to work with
13
+ ENV REF=main
14
+
12
15
SHELL ["pwsh", "-Command"]
13
16
14
17
# Output Powershell Version
@@ -105,11 +108,11 @@ RUN setx PATH '%JAVA_HOME%\bin;C:\Program Files\MariaDB 11.1\bin;%GIT_HOME%\bin;
105
108
# Echo PATH after update
106
109
RUN echo $Env:PATH
107
110
108
- # Clone HIRS main
111
+ # Clone HIRS main (or REF)
109
112
WORKDIR C:/
110
113
RUN git config --global --add core.autocrlf false
111
114
RUN git config --global --add safe.directory '*'
112
- RUN git clone -b main https://github.com/nsacyber/hirs.git C:/repo
115
+ RUN git clone -b ${REF} https://github.com/nsacyber/hirs.git C:/repo
113
116
114
117
# Defensive copy of the repo so it's easy to start fresh if needed
115
118
WORKDIR C:/repo
Original file line number Diff line number Diff line change 51
51
echo "PUBLIC_IMAGE_TAG=$PUBLIC_IMAGE_NAME:$IMAGE_TAG_VAR" >> "$GITHUB_OUTPUT"
52
52
- name : Print env
53
53
run : |
54
+ echo GITHUB_REF=$GITHUB_REF
54
55
echo DOCKERFILE_ROCKY=$DOCKERFILE_ROCKY
55
56
echo DOCKERFILE_WINDOWS=$DOCKERFILE_WINDOWS
56
57
echo IMAGE_NAME_ROCKY=$IMAGE_NAME_ROCKY
86
87
with :
87
88
context : " {{defaultContext}}:.ci/docker"
88
89
file : Dockerfile.${{env.DOCKERFILE_ROCKY}}
90
+ build-args : REF=$GITHUB_REF
89
91
tags : ${{env.TAG}}
90
92
push : true
91
93
@@ -108,7 +110,7 @@ jobs:
108
110
- name : Build the docker image for ${{ github.repository }}
109
111
run : |
110
112
cd ./.ci/docker
111
- docker build -f ./Dockerfile.${{env.DOCKERFILE_WINDOWS}} -t ${{env.TAG}} .
113
+ docker build -e "REF=$GITHUB_REF" - f ./Dockerfile.${{env.DOCKERFILE_WINDOWS}} -t ${{env.TAG}} .
112
114
113
115
- name : Push the docker image
114
116
run : |
@@ -133,7 +135,7 @@ jobs:
133
135
- name : Build the docker image for ${{ github.repository }}
134
136
run : |
135
137
cd ./.ci/docker
136
- docker build -f ./Dockerfile.${{env.DOCKERFILE_WINDOWS}} -t ${{env.TAG}} --build-arg BASE_IMAGE_TAG=lts-windowsservercore-1809 .
138
+ docker build -e "REF=$GITHUB_REF" - f ./Dockerfile.${{env.DOCKERFILE_WINDOWS}} -t ${{env.TAG}} --build-arg BASE_IMAGE_TAG=lts-windowsservercore-1809 .
137
139
138
140
- name : Push the docker image
139
141
run : |
You can’t perform that action at this time.
0 commit comments