Skip to content

Commit

Permalink
Add Dockerfile (#19)
Browse files Browse the repository at this point in the history
*Issue #, if available:* Closes #17

*Description of changes:* Provide a minimal Dockerfile to build a
container for the agent, along with a GitHub action.


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
  • Loading branch information
simonmarty authored Nov 25, 2024
1 parent cfc54c2 commit a279f54
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
target/
.github/
.vscode/
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
24 changes: 24 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Docker Image CI"

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: false
tags: test-build:latest
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:alpine as builder

WORKDIR /app

RUN apk add build-base ca-certificates
RUN update-ca-certificates

COPY . .

RUN cargo build --release

FROM scratch

WORKDIR /app

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app/target/release/aws_secretsmanager_agent .

ENTRYPOINT [ "./aws_secretsmanager_agent" ]

0 comments on commit a279f54

Please sign in to comment.