Skip to content

Commit a279f54

Browse files
authored
Add Dockerfile (#19)
*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.
1 parent cfc54c2 commit a279f54

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
target/
3+
.github/
4+
.vscode/

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ updates:
1515
directory: "/"
1616
schedule:
1717
interval: "weekly"
18+
- package-ecosystem: "docker"
19+
directory: "/"
20+
schedule:
21+
interval: "weekly"

.github/workflows/docker.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Docker Image CI"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v2
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
- name: Build
19+
uses: docker/build-push-action@v3
20+
with:
21+
context: .
22+
platforms: linux/amd64,linux/arm64
23+
push: false
24+
tags: test-build:latest

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM rust:alpine as builder
2+
3+
WORKDIR /app
4+
5+
RUN apk add build-base ca-certificates
6+
RUN update-ca-certificates
7+
8+
COPY . .
9+
10+
RUN cargo build --release
11+
12+
FROM scratch
13+
14+
WORKDIR /app
15+
16+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
17+
COPY --from=builder /app/target/release/aws_secretsmanager_agent .
18+
19+
ENTRYPOINT [ "./aws_secretsmanager_agent" ]

0 commit comments

Comments
 (0)