-
-
Notifications
You must be signed in to change notification settings - Fork 233
55 lines (52 loc) · 1.66 KB
/
Copy pathdocker.yml
File metadata and controls
55 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build Docker images
run-name: Build Docker images ${{ inputs.image_version }}${{ inputs.staging && ' (staging)' || '' }}
on:
workflow_dispatch:
inputs:
image_version:
description: "Image version"
required: true
staging:
description: "Build staging images"
type: boolean
default: false
env:
BUILD_DOCKER_REPO: ${{ inputs.staging && 'base-stgn' || 'base' }}
jobs:
build-docker:
defaults:
run:
working-directory: docker
runs-on: dstack-ubuntu-latest-32-cores
strategy:
matrix:
flavor: ["base", "devel", "devel-efa"]
ubuntu_version: ["24"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Free up some space
run: |
df -h /
du -hs /usr/share/dotnet
rm -rf /usr/share/dotnet
df -h /
- name: Build and upload to DockerHub
run: |
docker buildx build \
--platform linux/amd64 \
--target ${{ matrix.flavor }} \
--tag dstackai/${{ env.BUILD_DOCKER_REPO }}:${{ inputs.image_version }}-${{ matrix.flavor }}-ubuntu${{ matrix.ubuntu_version }}.04 \
--build-arg UBUNTU_VERSION=${{ matrix.ubuntu_version }} \
--provenance=false \
--push \
-f base/Dockerfile .