-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a docker container with kaniko
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 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,40 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: ['Dockerfile'] | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: ['Dockerfile'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: gcr.io/kaniko-project/executor:v1.22.0-debug | ||
|
||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | ||
|
||
- if: github.ref_name == github.event.repository.default_branch | ||
run: | | ||
# Tag with latest | ||
/kaniko/executor \ | ||
--context ${GITHUB_WORKSPACE} \ | ||
--dockerfile ${GITHUB_WORKSPACE}/Dockerfile \ | ||
--destination $IMAGE:latest \ | ||
--destination $IMAGE:$GITHUB_SHA \ | ||
--cache | ||
- if: github.ref_name != github.event.repository.default_branch | ||
run: | | ||
/kaniko/executor \ | ||
--context ${GITHUB_WORKSPACE} \ | ||
--dockerfile ${GITHUB_WORKSPACE}/Dockerfile \ | ||
--destination $IMAGE:$GITHUB_SHA \ | ||
--cache |
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,21 @@ | ||
# Base image with Rust and Alpine | ||
FROM rust:1.81-alpine3.20 AS builder | ||
|
||
# Install system dependencies and tools needed for Rust and your project | ||
RUN apk update && \ | ||
apk add --no-cache \ | ||
# For pcsc dependency | ||
pcsc-lite-dev \ | ||
# For tracing-attributes dependency (needs crti.o) | ||
musl-dev \ | ||
# For OpenSSL dependency | ||
pkgconf \ | ||
openssl-dev \ | ||
gcc \ | ||
make \ | ||
perl-dev \ | ||
# For cargo-msrv | ||
openssl-libs-static && \ | ||
# Install cargo-audit and cargo-msrv | ||
cargo install --version 0.20.1 cargo-audit && \ | ||
cargo install --version 0.15.1 cargo-msrv |