Skip to content

Commit

Permalink
feat: support dockerfile with multi openssl version
Browse files Browse the repository at this point in the history
  • Loading branch information
cavivie committed Mar 28, 2024
1 parent 25918c3 commit ebc0f27
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 30 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

# configure vcpkg to use the actions cache
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

jobs:
build:
Expand All @@ -35,7 +36,7 @@ jobs:
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1
with:
cosign-release: 'v2.1.1'

Expand All @@ -55,10 +56,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:chocolatey" chocolatey
- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:rust-windows" rust-windows
- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:rsxe-windows" rsxe-windows
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:rsxe-windows"
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:rust-windows"
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:chocolatey"
# Export required GitHub Actions envrionment variables,
# vcpkg will now upload or restore packages from the actions cache.
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:win-dev-base" win-dev-base
- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:win-dev-rust" win-dev-rust
- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:win-alrd-rsxe" rsxe-windows
- run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:win-alrd-rsxe" alrd-windows
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alrd-windows"
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:rsxe-windows"
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:win-dev-rust"
- run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:win-dev-base"
4 changes: 0 additions & 4 deletions chocolatey/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions rsxe-windows/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions rust-windows/Dockerfile

This file was deleted.

17 changes: 17 additions & 0 deletions win-alrd-rsxe/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ghcr.io/automesh-network/dockerfiles:win-dev-rust

RUN vcpkg install openssl:x64-windows openssl:x64-windows-static openssl:x64-windows-static-md
RUN vcpkg install openssl:x86-windows openssl:x86-windows-static openssl:x86-windows-static-md
RUN vcpkg install openssl:arm64-windows openssl:arm64-windows-static openssl:arm64-windows-static-md

RUN choco install git strawberryperl just -y

ARG RUST_STABLE_VERSION=1.76
ARG RUST_NIGHTLY_VERSION=2024-02-08
RUN rustup install $env:RUST_STABLE_VERSION
RUN rustup default $env:RUST_STABLE_VERSION
RUN rustup install nightly-$env:RUST_NIGHTLY_VERSION

ADD https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1 /install-from-binstall-release.ps1
RUN C:\install-from-binstall-release.ps1
RUN cargo binstall --secure --no-confirm cargo-tarpaulin cargo-audit cargo-nextest
15 changes: 15 additions & 0 deletions win-dev-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"]
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'))

RUN choco install visualstudio2022buildtools -y --package-parameters '--quiet --wait --norestart --add Microsoft.Component.MSBuild --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64'
RUN choco install git -y

ARG VCPKG_ROOT="C:\\vcpkg"
ARG VCPKG_VERSION=2024.03.25
RUN git clone https://github.com/microsoft/vcpkg.git $env:VCPKG_ROOT
RUN git -C $env:VCPKG_ROOT checkout $env:VCPKG_VERSION
RUN & "$env:VCPKG_ROOT\bootstrap-vcpkg.bat -disableMetrics"
RUN [Environment]::SetEnvironmentVariable('VCPKG_ROOT', $env:VCPKG_ROOT, [EnvironmentVariableTarget]::Machine)
RUN [Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';' + $env:VCPKG_ROOT, [EnvironmentVariableTarget]::Machine)
3 changes: 3 additions & 0 deletions win-dev-rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ghcr.io/automesh-network/dockerfiles:win-dev-base

RUN choco install rustup.install -y

0 comments on commit ebc0f27

Please sign in to comment.