Skip to content

Commit

Permalink
used docker buildx for save the docker image as tar file and also mov…
Browse files Browse the repository at this point in the history
…e the uploading of the docker to artifact below docker run verification
  • Loading branch information
Unique-Usman committed Oct 1, 2024
1 parent ee2eb99 commit a4136f8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/docker-build-and-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@ jobs:

- name: Build Docker image
run: |
docker build -t tf2.4_ivim-mri_codecollection -f Docker/Dockerfile .
docker buildx build --output type=tar,dest=tf2.4_ivim-mri_codecollection.tar -f Docker/Dockerfile .
- name: Save and compress Docker image
- name: Compress Docker image
run: |
docker save tf2.4_ivim-mri_codecollection | gzip > tf2.4_ivim-mri_codecollection.tar.gz
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: docker-image
path: tf2.4_ivim-mri_codecollection.tar.gz
gzip tf2.4_ivim-mri_codecollection.tar
- name: Run Docker container
run: |
Expand All @@ -73,6 +67,12 @@ jobs:
done
echo "All output files generated successfully"
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: docker-image
path: tf2.4_ivim-mri_codecollection.tar.gz

- name: Clean up artifacts and Docker image
run: |
docker rmi tf2.4_ivim-mri_codecollection || true
Expand Down

0 comments on commit a4136f8

Please sign in to comment.