Skip to content

Commit

Permalink
feat(build): add docker for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
adrobisch committed Apr 10, 2024
1 parent 3c5ee44 commit 33e81a8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: cli

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:cli"
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
1 change: 1 addition & 0 deletions cli/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
9 changes: 9 additions & 0 deletions cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rust:1.76 as builder
WORKDIR /usr/src/tresor
COPY . .
RUN cargo install --path .

FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/tresor-cli /usr/local/bin/tresor
CMD ["tresor"]

0 comments on commit 33e81a8

Please sign in to comment.