Skip to content

Commit

Permalink
use scratch container to run, update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nhudson committed Jul 31, 2024
1 parent b52d774 commit a7f38b5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
id: tags
run: |
BRANCH_NAME="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
echo "using branch: ${BRANCH_NAME}"
if [ "${BRANCH_NAME}" == "main" ]; then
echo "tag_latest=true" >> $GITHUB_OUTPUT
echo "tag_cargo=true" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cargo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Cargo lint and test
name: Cargo lint

on:
push:
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM rust:1.80 as builder
FROM rust:1.80-alpine as builder

WORKDIR /tembo-metrics

COPY . .

RUN cargo build --release
RUN apk update && apk upgrade && apk add --no-cache musl-dev openssl ca-certificates

FROM debian:bookworm-slim
RUN cargo build --release --target x86_64-unknown-linux-musl

RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*
FROM scratch

COPY --from=builder /tembo-metrics/target/release/tembo-metrics /usr/local/bin/tembo-metrics
COPY --from=builder /tembo-metrics/target/x86_64-unknown-linux-musl/release/tembo-metrics /tembo-metrics
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

CMD ["tembo-metrics"]
CMD ["/tembo-metrics"]
23 changes: 23 additions & 0 deletions sample-aws-iam-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1722444480676",
"Action": [
"cloudformation:ListStacks"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Sid": "Stmt1722444523636",
"Action": [
"servicequotas:GetServiceQuota",
"servicequotas:ListServiceQuotas",
"servicequotas:ListServices"
],
"Effect": "Allow",
"Resource": "*"
}
]
}

0 comments on commit a7f38b5

Please sign in to comment.