Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- prepare a musl based docker image - extend the ci release pipeline to build and publish the docker image as well - extend the docs for the docker usage
- Loading branch information
Showing
6 changed files
with
65 additions
and
2 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,3 @@ | ||
* | ||
!src | ||
!Cargo.* |
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 @@ | ||
name: Deploy to DockerHub | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
name: docker build & push | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: make image | ||
run: make image | ||
- name: make publish | ||
run: make publish |
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 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 ekidd/rust-musl-builder:latest as builder | ||
|
||
ADD --chown=rust:rust . ./ | ||
RUN cargo build --release | ||
|
||
# final image | ||
FROM alpine:latest | ||
|
||
LABEL name="ssd-benchmark" | ||
LABEL repository="https://github.com/sassman/ssd-benchmark-rs" | ||
LABEL homepage="https://github.com/sassman/ssd-benchmark-rs" | ||
LABEL maintainer="Sven Assmann" | ||
|
||
COPY .docker/entrypoint.sh /entrypoint.sh | ||
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/ssd-benchmark \ | ||
/usr/local/bin/ | ||
CMD /usr/local/bin/ssd-benchmark |
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,12 @@ | ||
VERSION:=latest | ||
SLUG:=ssd-benchmark | ||
|
||
image-m1: | ||
docker build -t 5422m4n/${SLUG}:${VERSION} . | ||
image: | ||
docker build --platform linux/amd64 \ | ||
-t 5422m4n/${SLUG}:${VERSION} . | ||
publish: | ||
docker push 5422m4n/${SLUG}:latest | ||
use: | ||
docker run --rm 5422m4n/${SLUG} |
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