Skip to content

Commit f3cbab4

Browse files
authored
Merge pull request #146 from DiamondLightSource/dockerfile
Add Dockerfile and corresponding workflow
2 parents 69d95a7 + a14dcd7 commit f3cbab4

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/container.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- "dockerfile"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push-image:
11+
if: ${{ github.repository == 'DiamondLightSource/httomolibgpu' }}
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
31+
with:
32+
images: |
33+
ghcr.io/${{ github.repository }}
34+
tags: |
35+
type=edge,branch=main
36+
type=ref,event=branch
37+
type=semver,pattern={{version}}
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM nvidia/cuda:11.6.2-devel-ubi8
2+
3+
RUN dnf install -y git && \
4+
dnf clean all

0 commit comments

Comments
 (0)