-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support dockerfile with multi openssl version
- Loading branch information
Showing
8 changed files
with
135 additions
and
35 deletions.
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,70 @@ | ||
name: 'Docker image build and push' | ||
description: 'Docker image build and push' | ||
inputs: | ||
push: | ||
description: 'Docker push after build' | ||
default: true | ||
registry: | ||
description: 'Docker image registry' | ||
default: 'ghcr.io' | ||
image: | ||
description: 'Docker image name' | ||
# github.repository as <account>/<repo> | ||
default: '${{ github.repository }}' | ||
tag: | ||
description: 'Docker image tag' | ||
required: true | ||
context: | ||
description: 'Docker build context' | ||
default: '.' | ||
file: | ||
description: 'Dockerfile in context' | ||
default: 'Dockerfile' | ||
shell: | ||
description: 'Shell to execute command' | ||
default: 'bash' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Test github event name on PR | ||
if: ${{ inputs.push == true || inputs.push == 'true' }} | ||
run: | | ||
echo "${{ inputs.push }}" | ||
echo "${{ github.event_name }}" | ||
echo "${{ github.event_name != 'pull_request' }}" | ||
exit -1 | ||
shell: bash | ||
|
||
- name: Test github event name on NON-PR | ||
if: ${{ inputs.push != true && inputs.push != 'true' }} | ||
run: | | ||
echo "${{ inputs.push }}" | ||
echo "${{ github.event_name }}" | ||
echo "${{ github.event_name != 'pull_request' }}" | ||
exit -1 | ||
shell: bash | ||
|
||
# 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 || ''); | ||
# Build docker image with vcpkg cache options: (x-gha: github-cache-token). | ||
- name: Build docker image ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.tag }} | ||
run: | | ||
docker build \ | ||
--build-arg VCPKG_BINARY_SOURCES="clear;x-gha,readwrite" \ | ||
--build-arg ACTIONS_CACHE_URL="${{ env.ACTIONS_CACHE_URL }}" \ | ||
--build-arg ACTIONS_CACHE_URL="${{ env.ACTIONS_RUNTIME_TOKEN }}" \ | ||
-t "${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.tag }}" ${{ inputs.context }} | ||
shell: ${{ inputs.shell }} | ||
|
||
# Push docker image to registry if the current github event is not pull request. | ||
- name: Push docker image ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.tag }} | ||
if: ${{ inputs.push == true || inputs.push == 'true' }} | ||
run: docker push "${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.tag }}" | ||
shell: ${{ inputs.shell }} |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,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 |
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,18 @@ | ||
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_BINARY_SOURCES= | ||
ARG ACTIONS_CACHE_URL= | ||
ARG ACTIONS_RUNTIME_TOKEN= | ||
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) |
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,3 @@ | ||
FROM ghcr.io/automesh-network/dockerfiles:win-dev-base | ||
|
||
RUN choco install rustup.install -y |