Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/actions/setup-ecr-buildx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: Setup ECR / Buildx
description: Composite action to setup requirements for ECR and buildx for docker pushes

inputs:
registry-type:
description: ECR Registry Type
default: private
iam-role-to-assume:
description: IAM Role to Assume
description: IAM Role to assume
required: true

outputs:
Expand All @@ -17,18 +14,21 @@ outputs:
runs:
using: "composite"
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4
with:
role-to-assume: ${{ inputs.iam-role-to-assume }}
role-session-name: github-action-session
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2

- name: Set up QEMU
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # 3.4.0
with:
registry-type: ${{ inputs.registry-type }}
image: tonistiigi/binfmt:qemu-v9.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
7 changes: 2 additions & 5 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Build and Push

# Builds and pushes the branch to ECR from master, or the manually selected branch when invoked manually. We stopped using Docker Hub for storing the image of oplogtoredis, where we used a Webhook to do the same thing.

on:
push:
branches:
- master
- main
# Left this here in-case the workflow needs to be developed further rapidly:
pull_request:
types: [ opened, synchronize, reopened ]
Expand All @@ -30,8 +28,7 @@ jobs:
uses: ./.github/actions/setup-ecr-buildx
id: setup-ecr-buildx
with:
iam-role-to-assume: ${{ secrets.AWS_PUBLIC_ECR_IAM_ROLE_ARN }}
registry-type: public
iam-role-to-assume: ${{ secrets.AWS_ECR_IAM_ROLE_ARN }}

- name: Build and push image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # 4.0.0
Expand Down
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 as builder
FROM golang:1.24 AS builder

WORKDIR /workspace

Expand All @@ -9,17 +9,10 @@ RUN go mod download
ADD . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o config-reloader-sidecar .

# UPX compression
FROM gruebel/upx:latest as upx

COPY --from=builder /workspace/config-reloader-sidecar .

RUN upx --best --lzma /config-reloader-sidecar

# Runtime

FROM gcr.io/distroless/static-debian11:latest
FROM gcr.io/distroless/static-debian12:latest

COPY --from=upx /config-reloader-sidecar .
COPY --from=builder /workspace/config-reloader-sidecar .

CMD ["/config-reloader-sidecar"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# config-reloader-sidecar

A small (3MB uncompressed docker image), efficient (via inotify) sidecar to trigger application reloads when configuration changes.
A small (1.5MB uncompressed docker image), efficient (via inotify) sidecar to trigger application reloads when configuration changes.

## Rationale

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/pluies/config-reloader-sidecar/v2

go 1.21
go 1.24

require (
github.com/bep/debounce v1.2.1
github.com/fsnotify/fsnotify v1.7.0
github.com/fsnotify/fsnotify v1.9.0
github.com/mitchellh/go-ps v1.0.0
golang.org/x/sys v0.24.0
golang.org/x/sys v0.35.0
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
Loading