diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 974e997..fd8b971 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: - v* +env: + REGISTRY: ghcr.io + jobs: release: runs-on: ubuntu-22.04 @@ -23,6 +26,18 @@ jobs: with: generate_release_notes: true make_latest: true + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v6 + with: + push: true + tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/sprocket:${{ github.ref_name }} build_artifacts: runs-on: ${{ matrix.os }} strategy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 49238d9..614a8f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +* Added a `Dockerfile` and automation to release Docker images with each Sprocket version ([#56](https://github.com/stjude-rust-labs/sprocket/pull/56)). + ## 0.10.0 - 01-17-2025 ### Added diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..36c3490 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM rust:1.82 AS builder + +WORKDIR /tmp/sprocket + +COPY Cargo.lock Cargo.toml ./ +COPY src/ src/ + +RUN cargo build --release + +FROM debian:bookworm + +COPY --from=builder /tmp/sprocket/target/release/sprocket /opt/sprocket/bin/sprocket + +ENV PATH=/opt/sprocket/bin:$PATH + +ENTRYPOINT ["sprocket"] +CMD ["--help"] \ No newline at end of file diff --git a/README.md b/README.md index 733b6e2..a1df5b7 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,14 @@ running the following command. cargo install sprocket ``` +### Docker + +Sprocket is available as a Docker [image](https://github.com/stjude-rust-labs/sprocket/pkgs/container/sprocket). + +```bash +docker pull ghcr.io/stjude-rust-labs/sprocket:v0.11.0 +``` + ## 🖥️ Development To bootstrap a development environment, please use the following commands.