Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a trunk image #83

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/publish-trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 🚀 Publish Trunk

on:
push:
branches:
- main
paths:
- 'trunk/**'
pull_request:
branches:
- main
paths:
- 'trunk/**'

jobs:
build-and-release:
name: 🚀 Build and Release
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Build Trunk
run: docker build ./trunk -t trunk
shell: bash
- name: Log into Quay
uses: docker/login-action@v2
with:
registry: ${{ secrets.QUAY_REPOSITORY }}
username: ${{ secrets.QUAY_USER_TEMBO }}
password: ${{ secrets.QUAY_PASSWORD_TEMBO }}
- name: Push to Quay
if: github.ref_name == 'main'
shell: bash
run: |
set -xe
TAG="$(perl -nE '/TRUNK_VER\s*=\s*(.+)/ && do { print $1; exit }' trunk/Dockerfile)"
docker tag $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:$TAG
docker push $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:$TAG
docker tag $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:latest
docker push $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:latest
8 changes: 8 additions & 0 deletions trunk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Build trunk.
FROM rust:1.83-bookworm AS build
ARG TRUNK_VER=0.15.10
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo install --version $TRUNK_VER pg-trunk

FROM scratch
COPY --from=build /usr/local/cargo/bin/trunk .
19 changes: 19 additions & 0 deletions trunk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<p align="center">
<img src="https://github.com/tembo-io/trunk/assets/8935584/905ef1f3-10ff-48b5-90af-74af74ebb1b1" width=25% height=25%>
</p>

# Trunk

[![Latest quay.io image tags](https://img.shields.io/github/v/tag/jupyterhub/docker-image-cleaner?include_prereleases&label=quay.io)](https://quay.io/repository/tembo/trunk)

This OCI contains a single file, `/trunk`, compiled from [the source]. Useful to add
to another image:

```Dockerfile
FROM quay.io/tembo/trunk:latest AS trunk
FROM ubuntu:22.04
COPY --from=trunk /trunk /usr/bin/trunk
RUN trunk --version
```

[the source]: https://github.com/tembo-io/trunk/
Loading