forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 5
151 lines (137 loc) · 5.35 KB
/
Copy pathprebuild-docker.yml
File metadata and controls
151 lines (137 loc) · 5.35 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Refresh docker NuGet cache
on:
push:
tags:
- "*"
branches:
- "hpcc-platform-10.6.x"
workflow_call:
inputs:
branch:
description: "The branch to build"
required: true
type: string
workflow_dispatch:
jobs:
build-images:
strategy:
matrix:
include:
- image: "wasm32-emscripten"
triplet: "wasm32-emscripten"
base_image: "ubuntu:24.04"
tag_postfix: ""
- image: "ubuntu-26.04"
triplet: "arm64-linux-dynamic"
base_image: "arm64v8/ubuntu:26.04"
tag_postfix: "-arm"
- image: "ubuntu-26.04"
triplet: "x64-linux-dynamic"
base_image: "ubuntu:26.04"
tag_postfix: ""
- image: "ubuntu-24.04"
triplet: "arm64-linux-dynamic"
base_image: "arm64v8/ubuntu:24.04"
tag_postfix: "-arm"
- image: "ubuntu-24.04"
triplet: "x64-linux-dynamic"
base_image: "ubuntu:24.04"
tag_postfix: ""
- image: "ubuntu-22.04"
triplet: "arm64-linux-dynamic"
base_image: "arm64v8/ubuntu:22.04"
tag_postfix: "-arm"
- image: "ubuntu-22.04"
triplet: "x64-linux-dynamic"
base_image: "ubuntu:22.04"
tag_postfix: ""
- image: "rockylinux-8"
triplet: "x64-linux-dynamic"
base_image: ""
tag_postfix: ""
fail-fast: false
name: "Docker: ${{ matrix.image }}-${{ matrix.triplet }}"
runs-on: ${{ matrix.tag_postfix == '' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
steps:
- name: Move Docker data-root to /mnt if available
run: |
if [ -d /mnt ]; then
sudo systemctl stop docker
sudo mkdir -p /mnt/docker-data
if [ -d /var/lib/docker ]; then
sudo rsync -aHAXx --delete /var/lib/docker/ /mnt/docker-data/
fi
echo '{ "data-root": "/mnt/docker-data" }' | sudo tee /etc/docker/daemon.json
sudo systemctl start docker
fi
- name: Free additional disk space (remove Android SDK + Tools)
continue-on-error: true
run: |
df -h
sudo rm -rf /usr/local/lib/android
sudo rm -rf ${JAVA_HOME_8_X64}
sudo rm -rf ${JAVA_HOME_11_X64}
sudo rm -rf ${JAVA_HOME_17_X64}
sudo rm -rf ${JAVA_HOME_21_X64}
sudo rm -rf ${CHROMEWEBDRIVER}
sudo rm -rf ${EDGEWEBDRIVER}
sudo rm -rf ${GECKOWEBDRIVER}
sudo rm -rf ${SELENIUM_JAR_PATH}
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Display disk space (post free)
run: |
df -h
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.branch || github.ref }}
- name: Calculate vars
id: vars
run: |
vcpkg_ref=${{ inputs.branch || github.ref }}
vcpkg_base_ref=${{ inputs.branch || github.event.base_ref || github.ref }}
echo "vcpkg_ref=$vcpkg_ref" >> $GITHUB_OUTPUT
echo "vcpkg_tag=$(echo $vcpkg_ref | cut -d'/' -f3)${{ matrix.tag_postfix }}" >> $GITHUB_OUTPUT
echo "vcpkg_branch=$(echo $vcpkg_base_ref | cut -d'/' -f3)" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short=8 HEAD)${{ matrix.tag_postfix }}" >> $GITHUB_OUTPUT
echo "repository_owner=${{ github.repository_owner }}" >> $GITHUB_OUTPUT
- name: Print vars
run: |
echo "${{ toJSON(steps.vars.outputs) }})"
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build ${{ matrix.image }} image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
file: dockerfiles/${{ matrix.image }}.dockerfile
context: .
push: ${{ steps.vars.outputs.repository_owner == 'hpcc-systems' }}
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
TRIPLET=${{ matrix.triplet }}
NUGET_MODE=readwrite
GITHUB_ACTOR=${{ github.repository_owner }}
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
BUILDKIT_INLINE_CACHE=1
tags: |
hpccsystems/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.sha_short }}
hpccsystems/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }}
cache-from: |
type=registry,ref=hpccsystems/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }}
cache-to: |
type=registry,ref=hpccsystems/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }},mode=max
- name: Show disk usage after build
if: always()
run: |
echo "Disk usage after Docker build:" && df -h