Skip to content

Commit a4136f8

Browse files
committed
used docker buildx for save the docker image as tar file and also move the uploading of the docker to artifact below docker run verification
1 parent ee2eb99 commit a4136f8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/docker-build-and-run.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,11 @@ jobs:
4444

4545
- name: Build Docker image
4646
run: |
47-
docker build -t tf2.4_ivim-mri_codecollection -f Docker/Dockerfile .
47+
docker buildx build --output type=tar,dest=tf2.4_ivim-mri_codecollection.tar -f Docker/Dockerfile .
4848
49-
- name: Save and compress Docker image
49+
- name: Compress Docker image
5050
run: |
51-
docker save tf2.4_ivim-mri_codecollection | gzip > tf2.4_ivim-mri_codecollection.tar.gz
52-
53-
- name: Upload Docker image artifact
54-
uses: actions/upload-artifact@v4
55-
with:
56-
name: docker-image
57-
path: tf2.4_ivim-mri_codecollection.tar.gz
51+
gzip tf2.4_ivim-mri_codecollection.tar
5852
5953
- name: Run Docker container
6054
run: |
@@ -73,6 +67,12 @@ jobs:
7367
done
7468
echo "All output files generated successfully"
7569
70+
- name: Upload Docker image artifact
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: docker-image
74+
path: tf2.4_ivim-mri_codecollection.tar.gz
75+
7676
- name: Clean up artifacts and Docker image
7777
run: |
7878
docker rmi tf2.4_ivim-mri_codecollection || true

0 commit comments

Comments
 (0)