-
Notifications
You must be signed in to change notification settings - Fork 239
47 lines (42 loc) · 1.57 KB
/
docker-images.yml
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
name: Check Docker images
on:
pull_request:
paths:
- Dockerfile
- Dockerfile.windows
- Makefile
- 'tools/make/*'
jobs:
# NOTE(rfratto): We only test building the Docker images for the host
# platform, but we're really only looking for issues that are
# architecture-independent.
linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
docker build -t alloy-test:latest -f Dockerfile .
windows:
runs-on: windows-latest
steps:
- name: Create Dev Drive using ReFS
run: |
$Volume = New-VHD -Path C:/dev_drive.vhdx -SizeBytes 10GB |
Mount-VHD -Passthru |
Initialize-Disk -Passthru |
New-Partition -AssignDriveLetter -UseMaximumSize |
Format-Volume -FileSystem ReFS -Confirm:$false -Force
Write-Output $Volume
Write-Output "DEV_DRIVE=$($Volume.DriveLetter):" >> $env:GITHUB_ENV
# actions/checkout does not let us clone anywhere outside the workspace
# so we have to copy the clone repository into the Dev drive.
- uses: actions/checkout@v4
- name: Copy repo to Dev Drive
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.DEV_DRIVE }}/work" -Recurse
- name: Build image
working-directory: ${{ env.DEV_DRIVE }}/work
run: |
docker build --help
docker build -t alloy-test:latest --cache-from type=local,src=${{ env.DEV_DRIVE }}/.docker-cache -f Dockerfile.windows .