forked from iqlusioninc/tmkms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ci/add-docker-builds' into hashicorp-feature-tmkms
- Loading branch information
Showing
3 changed files
with
47 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,33 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get version | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: Dockerfile.release | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.version-without-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 |
---|---|---|
|
@@ -11,3 +11,4 @@ tmkms.toml | |
/secrets | ||
/.vscode | ||
**/*.bin | ||
.DS_Store |
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,13 @@ | ||
FROM rust:1.75-alpine AS builder | ||
|
||
RUN apk add --no-cache g++ zlib zlib-dev git linux-headers libressl-dev libmagic libusb-dev hidapi-dev eudev-dev | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true | ||
RUN cargo build --release --features "$(grep 'feature =' src/keyring/providers.rs | tr -d '[:blank:]' | sort | uniq | cut -d '"' -f 2 | xargs)" | ||
|
||
FROM alpine | ||
COPY --from=builder /app/target/release/tmkms /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/tmkms"] |