Skip to content

Commit

Permalink
VLCLJ-2185 Add windows and linux dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
lisanna-dettwyler authored and bmyates committed May 1, 2024
1 parent 52ada59 commit d8256c4
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/docker/rhel.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# syntax=docker/dockerfile:1.4

ARG VMAJ
ARG VMIN

FROM ghcr.io/oneapi-src/level-zero-linux-compute/rhel:${VMAJ}.${VMIN}

SHELL ["/bin/bash", "-e", "-c"]
8 changes: 8 additions & 0 deletions .github/docker/sles.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# syntax=docker/dockerfile:1.4

ARG VMAJ
ARG VMIN

FROM ghcr.io/oneapi-src/level-zero-linux-compute/sles:${VMAJ}.${VMIN}

SHELL ["/bin/bash", "-e", "-c"]
58 changes: 58 additions & 0 deletions .github/docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# syntax=docker/dockerfile:1.4

ARG VMAJ
ARG VMIN
FROM ghcr.io/oneapi-src/level-zero-linux-compute/ubuntu:${VMAJ}.${VMIN}

ARG VMAJ
ARG VMIN

SHELL ["/bin/bash", "-e", "-c"]

RUN <<EOF
sed -i 's/^deb/deb [arch=amd64]/' /etc/apt/sources.list
source /etc/lsb-release
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${DISTRIB_CODENAME} main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${DISTRIB_CODENAME}-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${DISTRIB_CODENAME}-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ ${DISTRIB_CODENAME}-backports main restricted universe multiverse" >> /etc/apt/sources.list
dpkg --add-architecture arm64
EOF

ENV DEBIAN_FRONTEND=noninteractive
# /etc/apt/apt.conf.d/docker-clean doesn't work on older versions of docker for U2204 containers
RUN --mount=type=cache,target=/var/cache/apt <<EOF
rm /etc/apt/apt.conf.d/docker-clean
apt-get update
apt-get install -y \
build-essential \
ccache \
cmake \
universal-ctags \
curl \
elfutils \
file \
$(if [[ "${VMAJ}.${VMIN}" != "19.10" ]]; then echo \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
$(if ((VMAJ >= 20)); then echo \
gcc-10-aarch64-linux-gnu \
g++-10-aarch64-linux-gnu; fi) \
libc6:arm64 \
libstdc++6:arm64; fi) \
git \
ninja-build
rm -rf /var/lib/apt/lists/*
EOF

# Make newest version of aarch64 toolchain the default and enable switching.
RUN <<EOF
shopt -s extglob
for tool in $(ls /usr/bin/aarch64-linux-gnu-*([a-z\-+])); do
for v in $(ls /usr/bin/aarch64-linux-gnu-* | grep -o [0-9]*$ | sort | uniq); do
if [[ -f ${tool}-${v} ]]; then
update-alternatives --install ${tool} $(basename ${tool}) ${tool}-${v} ${v}
fi
done
done
EOF
46 changes: 46 additions & 0 deletions .github/docker/windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# escape=`

ARG BASE_IMAGE=mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
FROM ${BASE_IMAGE}

SHELL ["powershell"]
RUN New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
ENV VS_VERSION=2019
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
Switch ($env:VS_VERSION) { `
"2019" {$url_version = "16"} `
"2022" {$url_version = "17"} `
default {echo "Unsupported VS version $env:VS_VERSION"; EXIT 1} `
}; `
wget -Uri https://aka.ms/vs/${url_version}/release/vs_buildtools.exe -OutFile vs_buildtools.exe
SHELL ["cmd", "/S", "/C"]
RUN (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\%VS_VERSION%\BuildTools" `
--add Microsoft.Component.MSBuild `
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools `
--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest `
--add Microsoft.VisualStudio.Component.Windows10SDK `
--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre `
|| IF "%ERRORLEVEL%"=="3010" EXIT 0) `
&& del /q vs_buildtools.exe `
&& mklink /d "C:\Program Files (x86)\Microsoft Visual Studio\current" "C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%" `
&& if not exist "C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%\BuildTools\Common7\Tools\VsDevCmd.bat" exit 1
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\current\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&"]

SHELL ["powershell"]
ENV chocolateyUseWindowsCompression false
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
SHELL ["cmd", "/S", "/C"]
RUN call "%ProgramFiles(x86)%\Microsoft Visual Studio\current\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && `
powershell -command "[Environment]::SetEnvironmentVariable('Path', $env:Path, [System.EnvironmentVariableTarget]::Machine)"
RUN choco feature disable --name showDownloadProgress && `
choco install -y --fail-on-error-output git -params '"/GitAndUnixToolsOnPath"' && `
choco install -y --fail-on-error-output 7zip && `
choco install -y --fail-on-error-output ccache && `
choco install -y --fail-on-error-output cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' && `
choco install -y --fail-on-error-output ninja

0 comments on commit d8256c4

Please sign in to comment.