-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from Concordium/lma/dockerimage
Lma/dockerimage
- Loading branch information
Showing
4 changed files
with
105 additions
and
16 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,41 @@ | ||
name: Release workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
RUST_VERSION: rust:1.70-buster | ||
|
||
jobs: | ||
|
||
build-and-push: | ||
runs-on: ubuntu-latest | ||
environment: release-recover-id-object | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: Extract Cargo package version | ||
id: cargo_version | ||
run: | | ||
cd recover-id-object | ||
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') | ||
echo "Extracted version is $VERSION" | ||
echo "::set-output name=version::$VERSION" | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: recover-id-object/scripts/Dockerfile | ||
push: true | ||
build-args: | | ||
build_image=${{ env.RUST_VERSION }} | ||
tags: concordium/recover-id-object:${{ steps.cargo_version.outputs.version }} |
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,7 @@ | ||
# Assumes docker context is repository root, i.e. ../ relative to this file. | ||
* | ||
!deps/concordium-rust-sdk | ||
deps/concordium-rust-sdk/target | ||
!recover-id-object/* | ||
recover-id-object/target | ||
recover-id-object/scripts |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,24 @@ | ||
ARG build_image=rust:1.70-buster | ||
ARG base_image=debian:buster-slim | ||
FROM ${build_image} AS build | ||
|
||
WORKDIR /usr/app/recover-id-object | ||
|
||
COPY recover-id-object . | ||
COPY deps /usr/app/deps | ||
RUN cargo build --release --locked | ||
|
||
FROM ${base_image} | ||
|
||
WORKDIR /usr/app | ||
|
||
COPY --from=build /usr/app/recover-id-object/target/release/recover-id-object ./recover-id-object | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install \ | ||
ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN chmod +x recover-id-object | ||
|
||
ENTRYPOINT ["./recover-id-object"] |