Skip to content

Commit

Permalink
Add Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
conradkleinespel committed Oct 31, 2024
1 parent 7d432b4 commit 39f2446
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/target
/libm8s/target
/libm8scmd/target
/m8s/target
/githooks
/.idea
/.github
/.git
38 changes: 32 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
name: ${{ runner.os }}-${{ runner.arch }}-binary
path: target/release/m8s

release:
release-binary:
needs: build
runs-on: ubuntu-latest
permissions:
Expand All @@ -63,12 +63,38 @@ jobs:
run: |
set -ex
TAG_NAME=${GITHUB_REF#refs/tags/}
gh release create "$TAG_NAME" -t "$TAG_NAME" --generate-notes
gh release create "${{ github.ref_name }}" -t "${{ github.ref_name }}" --generate-notes
mv ./binaries-linux-x64/m8s ./binaries-linux-x64/m8s-linux-x64
gh release upload "$TAG_NAME" ./binaries-linux-x64/m8s-linux-x64
gh release upload "${{ github.ref_name }}" ./binaries-linux-x64/m8s-linux-x64
mv ./binaries-macos-arm64/m8s ./binaries-macos-arm64/m8s-macos-arm64
gh release upload "$TAG_NAME" ./binaries-macos-arm64/m8s-macos-arm64
gh release upload "${{ github.ref_name }}" ./binaries-macos-arm64/m8s-macos-arm64
release-docker:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rust:alpine AS builder
COPY . /app
WORKDIR /app
RUN apk add musl-dev
RUN cargo build --release

FROM alpine
COPY --from=builder /app/target/release/m8s /usr/bin/m8s
ENTRYPOINT ["/usr/bin/m8s"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

`m8s`, pronounced "mates", is a tool for declarative k8s deployment using Kubectl, Helm and more.

## Install

Download the latest binary for Linux or macOS here:
https://github.com/conradkleinespel/m8s/releases/latest

Or run using Docker:
```shell
docker run --rm -it ghcr.io/conradkleinespel/m8s up --help
```

## Why use `m8s`?

`m8s` is helpful in the following situations :
Expand Down

0 comments on commit 39f2446

Please sign in to comment.