Skip to content

Commit

Permalink
Allow addition of custom ca-certificates (when running container as r…
Browse files Browse the repository at this point in the history
…oot)
  • Loading branch information
Argelbargel committed Mar 28, 2024
1 parent 848527d commit abbc15b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/release.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ LABEL org.opencontainers.image.source=https://github.com/Argelbargel/vault-raft-
LABEL org.opencontainers.image.description="vault-raft-snapshot-agent ($TARGETPLATFORM)"
LABEL org.opencontainers.image.licenses=MIT

ENTRYPOINT ["/bin/vault-raft-snapshot-agent"]
RUN apk --no-cache add ca-certificates \
&& rm -rf /var/cache/apk/*

VOLUME /etc/vault.d/
WORKDIR /

ARG DIST_DIR
ARG TARGETOS
ARG TARGETARCH
COPY ${DIST_DIR}/entrypoint /sbin/entrypoint
COPY ${DIST_DIR}/vault-raft-snapshot-agent_${TARGETOS}_${TARGETARCH} /bin/vault-raft-snapshot-agent
RUN chmod +x /bin/vault-raft-snapshot-agent
RUN chmod +x /sbin/entrypoint /bin/vault-raft-snapshot-agent

WORKDIR /
ENTRYPOINT ["/sbin/entrypoint"]
5 changes: 5 additions & 0 deletions .github/workflows/release-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ jobs:
name: binaries
path: dist/

- name: Copy entrypoint
id: copy_entrypoint
run: |
cp -f init/entrypoint dist/entrypoint
- name: Login to Github Packages
uses: docker/login-action@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions init/entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash
set -eu

if [ -d /etc/vault.d/certs ]; then
echo "Updating certificates"
cp /etc/vault.d/certs /usr/local/share/ca-certificates
update-ca-certificates
fi

echo "Starting agent..."
exec /bin/vault-raft-snapshot-agent

0 comments on commit abbc15b

Please sign in to comment.