Compare commits

...

6 commits
main ... docker

Author SHA1 Message Date
Frank Villaro-Dixon 55004fbd61 add tag 0.0.2
All checks were successful
ci / docker-build (push) Successful in 4m1s
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-24 22:57:18 +02:00
Frank Villaro-Dixon 589fe948cf test2
Some checks failed
ci / docker-build (push) Has been cancelled
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-24 22:54:50 +02:00
Frank Villaro-Dixon ef0b2e34c1 fix canonical name
Some checks failed
ci / docker-build (push) Failing after 19s
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-24 22:52:16 +02:00
Frank Villaro-Dixon 41db3fc3e4 hello
Some checks failed
ci / docker-build (push) Failing after 20s
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-24 22:50:20 +02:00
Frank Villaro-Dixon 188ec25586 push tags
Some checks failed
ci / docker-build (push) Failing after 19s
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-24 22:34:06 +02:00
Frank Villaro-Dixon 8138911e25 build dockerfile
All checks were successful
ci / docker-build (push) Successful in 4m26s
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-24 22:19:35 +02:00
3 changed files with 79 additions and 0 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
.git
target

View file

@ -0,0 +1,54 @@
name: ci
on:
push:
branches:
- docker
tags:
- '*'
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Forge Hub
uses: docker/login-action@v3
with:
registry: forge.k3s.fr
username: ${{ secrets.FORGEHUB_USERNAME }}
password: ${{ secrets.FORGEHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Forge hub
id: metaforge
uses: https://github.com/docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: forge.k3s.fr/frank/opentsdb-auth-proxy
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.metaforge.outputs.tags }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Forge hub
id: metadockerhub
uses: https://github.com/docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: frankkkkk/opentsdb-auth-proxy
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.metadockerhub.outputs.tags }}

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM rust:1.78 AS chef
# We only pay the installation cost once,
# it will be cached from the second build onwards
RUN cargo install cargo-chef
WORKDIR app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin opentsdb-auth-proxy
# We do not need the Rust toolchain to run the binary!
FROM ubuntu:22.04
WORKDIR app
COPY --from=builder /app/target/release/opentsdb-auth-proxy /usr/local/bin
ENTRYPOINT ["/usr/local/bin/opentsdb-auth-proxy"]