-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Support #71
Open
yodaldevoid
wants to merge
3
commits into
rust-lang:master
Choose a base branch
from
yodaldevoid:windows
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Windows Support #71
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build Docker Images | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-images: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
#VERSIONS | ||
- variant: buster | ||
os: ubuntu-18.04 | ||
version: 1.50.0 | ||
- variant: buster/slim | ||
os: ubuntu-18.04 | ||
version: 1.50.0 | ||
- variant: alpine3.12 | ||
os: ubuntu-18.04 | ||
version: 1.50.0 | ||
- variant: alpine3.13 | ||
os: ubuntu-18.04 | ||
version: 1.50.0 | ||
- variant: windowsservercore-1809/msvc | ||
os: windows-2019 | ||
version: 1.50.0 | ||
- variant: windowsservercore-1809/gnu | ||
os: windows-2019 | ||
version: 1.50.0 | ||
#VERSIONS | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Check out Docker official images repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: docker-library/official-images | ||
path: official-images | ||
- name: Build and test docker image | ||
shell: bash | ||
env: | ||
VERSION: ${{ matrix.version }} | ||
VARIANT: ${{ matrix.variant }} | ||
run: | | ||
env | sort | ||
cd "${VERSION}/${VARIANT}" | ||
slash='/'; image="rust:${VERSION}-${VARIANT//$slash/-}" | ||
docker build -t "$image" . | ||
${GITHUB_WORKSPACE}/official-images/test/run.sh "$image" | ||
docker images |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# escape=` | ||
|
||
FROM mcr.microsoft.com/windows/servercore:1809 | ||
|
||
SHELL ["powershell.exe", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
ENV RUSTUP_HOME=C:\rustup ` | ||
CARGO_HOME=C:\cargo ` | ||
RUST_VERSION=1.50.0 | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` | ||
$url = 'https://static.rust-lang.org/rustup/archive/1.23.1/x86_64-pc-windows-msvc/rustup-init.exe'; ` | ||
$sha256 = 'a586cf9de3e4aa791fd5796b6a5f99ca05591ccef8bb94e53af5b69f0261fb03'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\rustup-init.exe; ` | ||
$actual256 = (Get-FileHash rustup-init.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
New-Item ${env:CARGO_HOME}\bin -type directory | Out-Null; ` | ||
$newPath = ('{0}\bin;{1}' -f ${env:CARGO_HOME}, ${env:PATH}); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Process); ` | ||
C:\rustup-init.exe -y -v --no-modify-path --default-toolchain ${env:RUST_VERSION} --default-host x86_64-pc-windows-gnu; ` | ||
Remove-Item C:\rustup-init.exe; ` | ||
rustup -V; ` | ||
cargo -V; ` | ||
rustc -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# escape=` | ||
|
||
# IMAGES BUILT FROM THIS DOCKERFILE ARE NOT TO BE SHARED ON PUBLIC DOCKER HUBs. | ||
# | ||
# WARNING: NON-FREE AND DISTRIBUTION RESTRICTED ENCUMBERED SOFTWARE IN IMAGE. | ||
# | ||
# The VS Build Tools are very encumbered. | ||
# | ||
# IMAGE SHOULD ONLY BE BUILT BY USERS WHO CAN FOLLOW THESE TERMS: | ||
# https://visualstudio.microsoft.com/license-terms/mlt553512/ | ||
# | ||
# See the fourth paragraph of this blog post for a warning from a Microsoftie: | ||
# https://blogs.msdn.microsoft.com/vcblog/2018/08/13/using-msvc-in-a-docker-container-for-your-c-projects/ | ||
# | ||
# """ | ||
# The VS Build Tools are licensed as a supplement to your existing Visual Studio license. | ||
# Any images built with these tools should be for your personal use or for use in your | ||
# organization in accordance with your existing Visual Studio and Windows licenses. | ||
# Please don’t share these images on a public Docker hub. | ||
# """ | ||
# | ||
# That said, this Dockerfile will be built in a CI system for validation and testing in the project | ||
# but most definitely will skip deployment. | ||
|
||
FROM mcr.microsoft.com/windows/servercore:1809 | ||
|
||
SHELL ["powershell.exe", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
RUN $url = 'https://download.visualstudio.microsoft.com/download/pr/20130c62-1bc8-43d6-b4f0-c20bb7c79113/7276a7355219f7988c480d198e23c2973bbb7ab971c4f0415c26cab2955344e5/vs_BuildTools.exe'; ` | ||
$sha256 = '7276A7355219F7988C480D198E23C2973BBB7AB971C4F0415C26CAB2955344E5'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\vs_BuildTools.exe; ` | ||
$actual256 = (Get-FileHash vs_BuildTools.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
Start-Process -filepath C:\vs_BuildTools.exe -wait -argumentlist ' ` | ||
--quiet --wait --norestart --nocache ` | ||
--installPath C:\BuildTools ` | ||
--add Microsoft.Component.MSBuild ` | ||
--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ` | ||
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64'; ` | ||
Remove-Item 'C:\\vs_BuildTools.exe'; ` | ||
Remove-Item -Force -Recurse 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer'; ` | ||
[Environment]::SetEnvironmentVariable('__VSCMD_ARG_NO_LOGO', '1', [EnvironmentVariableTarget]::Machine) | ||
|
||
ENV RUSTUP_HOME=C:\rustup ` | ||
CARGO_HOME=C:\cargo ` | ||
RUST_VERSION=1.50.0 | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` | ||
$url = 'https://static.rust-lang.org/rustup/archive/1.23.1/x86_64-pc-windows-msvc/rustup-init.exe'; ` | ||
$sha256 = 'a586cf9de3e4aa791fd5796b6a5f99ca05591ccef8bb94e53af5b69f0261fb03'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\rustup-init.exe; ` | ||
$actual256 = (Get-FileHash rustup-init.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
New-Item ${env:CARGO_HOME}\bin -type directory | Out-Null; ` | ||
$newPath = ('{0}\bin;{1}' -f ${env:CARGO_HOME}, ${env:PATH}); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Process); ` | ||
C:\rustup-init.exe -y -v --no-modify-path --default-toolchain ${env:RUST_VERSION} --default-host x86_64-pc-windows-msvc; ` | ||
Remove-Item C:\rustup-init.exe; ` | ||
rustup -V; ` | ||
cargo -V; ` | ||
rustc -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# escape=` | ||
|
||
FROM mcr.microsoft.com/windows/servercore:%%WINDOWS-VERSION%% | ||
|
||
SHELL ["powershell.exe", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
ENV RUSTUP_HOME=C:\rustup ` | ||
CARGO_HOME=C:\cargo ` | ||
RUST_VERSION=%%RUST-VERSION%% | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` | ||
$url = 'https://static.rust-lang.org/rustup/archive/%%RUSTUP-VERSION%%/x86_64-pc-windows-msvc/rustup-init.exe'; ` | ||
$sha256 = '%%RUSTUP-SHA256%%'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\rustup-init.exe; ` | ||
$actual256 = (Get-FileHash rustup-init.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
New-Item ${env:CARGO_HOME}\bin -type directory | Out-Null; ` | ||
$newPath = ('{0}\bin;{1}' -f ${env:CARGO_HOME}, ${env:PATH}); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Process); ` | ||
C:\rustup-init.exe -y -v --no-modify-path --default-toolchain ${env:RUST_VERSION} --default-host x86_64-pc-windows-gnu; ` | ||
Remove-Item C:\rustup-init.exe; ` | ||
rustup -V; ` | ||
cargo -V; ` | ||
rustc -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# escape=` | ||
|
||
# IMAGES BUILT FROM THIS DOCKERFILE ARE NOT TO BE SHARED ON PUBLIC DOCKER HUBs. | ||
# | ||
# WARNING: NON-FREE AND DISTRIBUTION RESTRICTED ENCUMBERED SOFTWARE IN IMAGE. | ||
# | ||
# The VS Build Tools are very encumbered. | ||
# | ||
# IMAGE SHOULD ONLY BE BUILT BY USERS WHO CAN FOLLOW THESE TERMS: | ||
# https://visualstudio.microsoft.com/license-terms/mlt553512/ | ||
# | ||
# See the fourth paragraph of this blog post for a warning from a Microsoftie: | ||
# https://blogs.msdn.microsoft.com/vcblog/2018/08/13/using-msvc-in-a-docker-container-for-your-c-projects/ | ||
# | ||
# """ | ||
# The VS Build Tools are licensed as a supplement to your existing Visual Studio license. | ||
# Any images built with these tools should be for your personal use or for use in your | ||
# organization in accordance with your existing Visual Studio and Windows licenses. | ||
# Please don’t share these images on a public Docker hub. | ||
# """ | ||
# | ||
# That said, this Dockerfile will be built in a CI system for validation and testing in the project | ||
# but most definitely will skip deployment. | ||
|
||
FROM mcr.microsoft.com/windows/servercore:%%WINDOWS-VERSION%% | ||
|
||
SHELL ["powershell.exe", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
RUN $url = 'https://download.visualstudio.microsoft.com/download/pr/20130c62-1bc8-43d6-b4f0-c20bb7c79113/7276a7355219f7988c480d198e23c2973bbb7ab971c4f0415c26cab2955344e5/vs_BuildTools.exe'; ` | ||
$sha256 = '7276A7355219F7988C480D198E23C2973BBB7AB971C4F0415C26CAB2955344E5'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\vs_BuildTools.exe; ` | ||
$actual256 = (Get-FileHash vs_BuildTools.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
Start-Process -filepath C:\vs_BuildTools.exe -wait -argumentlist ' ` | ||
--quiet --wait --norestart --nocache ` | ||
--installPath C:\BuildTools ` | ||
--add Microsoft.Component.MSBuild ` | ||
--add Microsoft.VisualStudio.Component.Windows10SDK.%%SDK-BUILD%% ` | ||
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64'; ` | ||
Remove-Item 'C:\\vs_BuildTools.exe'; ` | ||
Remove-Item -Force -Recurse 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer'; ` | ||
[Environment]::SetEnvironmentVariable('__VSCMD_ARG_NO_LOGO', '1', [EnvironmentVariableTarget]::Machine) | ||
|
||
ENV RUSTUP_HOME=C:\rustup ` | ||
CARGO_HOME=C:\cargo ` | ||
RUST_VERSION=%%RUST-VERSION%% | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` | ||
$url = 'https://static.rust-lang.org/rustup/archive/%%RUSTUP-VERSION%%/x86_64-pc-windows-msvc/rustup-init.exe'; ` | ||
$sha256 = '%%RUSTUP-SHA256%%'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\rustup-init.exe; ` | ||
$actual256 = (Get-FileHash rustup-init.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
New-Item ${env:CARGO_HOME}\bin -type directory | Out-Null; ` | ||
$newPath = ('{0}\bin;{1}' -f ${env:CARGO_HOME}, ${env:PATH}); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Process); ` | ||
C:\rustup-init.exe -y -v --no-modify-path --default-toolchain ${env:RUST_VERSION} --default-host x86_64-pc-windows-msvc; ` | ||
Remove-Item C:\rustup-init.exe; ` | ||
rustup -V; ` | ||
cargo -V; ` | ||
rustc -V |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent of this PR is to produce images that are to be shared on public Docker hubs, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure at this point. I had completely missed this license issue until I was reading through @nelsonjchen's implementation. This issue was brought up by them before a few years ago and I didn't see any discussion about it.
I see value in providing a dockerfile for a base Rust on Windows image, but I don't know whether this repo is the right place for that. If we do keep this base dockerfile here, we would just need to make sure not to add it to the manifest file.